update containerd/console to fix race: lock Cond before Signal

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2018-07-06 17:26:22 +02:00
parent 5900361791
commit 77a26427c3
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,5 @@
github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd5 github.com/containerd/go-runc f271fa2021de855d4d918dbef83c5fe19db1bdd5
github.com/containerd/console 9290d21dc56074581f619579c43d970b4514bc08 github.com/containerd/console 5d1b48d6114b8c9666f0c8b916f871af97b0a761
github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40 github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c

View File

@ -262,10 +262,14 @@ func (ec *EpollConsole) Shutdown(close func(int) error) error {
// signalRead signals that the console is readable. // signalRead signals that the console is readable.
func (ec *EpollConsole) signalRead() { func (ec *EpollConsole) signalRead() {
ec.readc.L.Lock()
ec.readc.Signal() ec.readc.Signal()
ec.readc.L.Unlock()
} }
// signalWrite signals that the console is writable. // signalWrite signals that the console is writable.
func (ec *EpollConsole) signalWrite() { func (ec *EpollConsole) signalWrite() {
ec.writec.L.Lock()
ec.writec.Signal() ec.writec.Signal()
ec.writec.L.Unlock()
} }