diff options
Diffstat (limited to 'src/pkg/runtime/lock_sema.c')
| -rw-r--r-- | src/pkg/runtime/lock_sema.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/runtime/lock_sema.c b/src/pkg/runtime/lock_sema.c index be4d306d1f..069b8c1ad3 100644 --- a/src/pkg/runtime/lock_sema.c +++ b/src/pkg/runtime/lock_sema.c @@ -5,6 +5,7 @@ // +build darwin netbsd openbsd plan9 windows #include "runtime.h" +#include "stack.h" // This implementation depends on OS-specific implementations of // @@ -112,6 +113,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. |
