aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/lock_futex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/lock_futex.c')
-rw-r--r--src/pkg/runtime/lock_futex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/runtime/lock_futex.c b/src/pkg/runtime/lock_futex.c
index 5309a21a13..95d590bae9 100644
--- a/src/pkg/runtime/lock_futex.c
+++ b/src/pkg/runtime/lock_futex.c
@@ -5,6 +5,7 @@
// +build freebsd linux
#include "runtime.h"
+#include "stack.h"
// This implementation depends on OS-specific implementations of
//
@@ -99,6 +100,8 @@ runtime·unlock(Lock *l)
if(--m->locks < 0)
runtime·throw("runtime·unlock: lock count");
+ if(m->locks == 0 && g->preempt) // restore the preemption request in case we've cleared it in newstack
+ g->stackguard0 = StackPreempt;
}
// One-time notifications.