aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/lock_futex.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2012-12-24 21:06:57 +0400
committerDmitriy Vyukov <dvyukov@google.com>2012-12-24 21:06:57 +0400
commit4380fa6d99284c03e471bafcb1be2db83b225af4 (patch)
tree184aebd735a685281658a6b8bed68449233164b1 /src/pkg/runtime/lock_futex.c
parentcfcc3ebfa4358c7c5d94c2a9b32481ab0fb3aeaf (diff)
downloadgo-4380fa6d99284c03e471bafcb1be2db83b225af4.tar.xz
runtime: diagnose double wakeup on Note
Double wakeup is prohibited by the Note interface and checked in lock_sema.c. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6976054
Diffstat (limited to 'src/pkg/runtime/lock_futex.c')
-rw-r--r--src/pkg/runtime/lock_futex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/lock_futex.c b/src/pkg/runtime/lock_futex.c
index b4465bff18..9b1f5f6db4 100644
--- a/src/pkg/runtime/lock_futex.c
+++ b/src/pkg/runtime/lock_futex.c
@@ -111,7 +111,8 @@ runtime·noteclear(Note *n)
void
runtime·notewakeup(Note *n)
{
- runtime·xchg(&n->key, 1);
+ if(runtime·xchg(&n->key, 1))
+ runtime·throw("notewakeup - double wakeup");
runtime·futexwakeup(&n->key, 1);
}