natefinch / npipe

A Windows named pipe implementation written in pure Go.
MIT License
297 stars 73 forks source link

Protect PipeListener with a mutex. #17

Closed cmars closed 8 years ago

cmars commented 8 years ago

There's a race condition in which PipeListener.Accept and PipeListener.Close are called from separate goroutines. Either method can mutate the state of the PipeListener (l.closed, l.handler). These sections need to be protected with a mutex.

cmars commented 8 years ago

Trying to fix the test hang issue in https://bugs.launchpad.net/juju-core/+bug/1581157. The thing is, I think the same thing could happen to the uniter.

cmars commented 8 years ago

See #19 for my latest attempt at fixing this...