Race condition that causes Signal() loss

There's a race condition between Wait() and Signal(). Wait() grabs the channel and then drops the lock. Signal() can then grab the lock and try to write to the channel before Wait() started blocking on the channel. The select{} in Signal() will see there is no reader yet and drop the signal.