diff options
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r-- | src/runtime/export_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 9b765550ca..3b33c8422b 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -245,3 +245,16 @@ func CountPagesInUse() (pagesInUse, counted uintptr) { return } + +// BlockOnSystemStack switches to the system stack, prints "x\n" to +// stderr, and blocks in a stack containing +// "runtime.blockOnSystemStackInternal". +func BlockOnSystemStack() { + systemstack(blockOnSystemStackInternal) +} + +func blockOnSystemStackInternal() { + print("x\n") + lock(&deadlock) + lock(&deadlock) +} |