Skip to content

Commit d3ea05a

Browse files
committed
return early for closed console during shutdown
Signed-off-by: Henry Wang <[email protected]>
1 parent 8f6c4e4 commit d3ea05a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

console_linux.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ func (ec *EpollConsole) Shutdown(close func(int) error) error {
260260
ec.writec.L.Lock()
261261
defer ec.writec.L.Unlock()
262262

263+
if ec.closed {
264+
return nil
265+
}
266+
263267
ec.readc.Broadcast()
264268
ec.writec.Broadcast()
265269
ec.closed = true

0 commit comments

Comments
 (0)