From: Dmitriy Vyukov Date: Mon, 24 Dec 2012 17:06:57 +0000 (+0400) Subject: runtime: diagnose double wakeup on Note X-Git-Tag: go1.1rc2~1531 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4380fa6d99284c03e471bafcb1be2db83b225af4;p=gostls13.git 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 --- 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); }