Commit 4380fa6d authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent cfcc3ebf
...@@ -111,7 +111,8 @@ runtime·noteclear(Note *n) ...@@ -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);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment