1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:44:44 -07:00

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
This commit is contained in:
Dmitriy Vyukov 2012-12-24 21:06:57 +04:00
parent cfcc3ebfa4
commit 4380fa6d99

View File

@ -111,7 +111,8 @@ runtime·noteclear(Note *n)
void void
runtime·notewakeup(Note *n) 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); runtime·futexwakeup(&n->key, 1);
} }