Skip to content

v1.2.37

@liukun liukun tagged this 09 Nov 02:11
Close closes the die channel and then wakes the poll loop. If Wait observes
die before the wakeup is sent, it exits and releases the wakeup descriptor,
and wakeup then reports ErrPollerClosed. That is the outcome Close asked
for, so treat it as success instead of failing Close.

The window is easiest to hit right after NewWatcher, before the Wait
goroutine has started polling. Windows is affected more often because
WSAPoll returns to the die check every 100ms; epoll_wait and kevent block
indefinitely, so Unix only has the startup window. TestCloseIsIdempotent
failed with "poller closed" this way on windows-latest under -race.
Assets 2
Loading