]> Cypherpunks repositories - gostls13.git/commit
sync: always wake up previously sleeping goroutines on Cond.Signal
authorGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 1 Jun 2011 23:30:42 +0000 (20:30 -0300)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 1 Jun 2011 23:30:42 +0000 (20:30 -0300)
commit17bfa32fde692b3d299ced5e1879b4f6bfefbfac
tree2f741ef2d0a0b1d915018d8e81513b975cc6c05b
parent158b427ea5692d180fd5b60c9093a29749c5a2f6
sync: always wake up previously sleeping goroutines on Cond.Signal

This changes the internal implementation of Cond so that
it uses two generations of waiters.  This enables Signal
to guarantee that it will only wake up waiters that are
currently sleeping at the call time.

Fixes #1648.

R=dvyukov, gustavo, rsc
CC=golang-dev
https://golang.org/cl/4524083
src/pkg/sync/cond.go
src/pkg/sync/cond_test.go