Skip to content

Commit d013b71

Browse files
committed
eventfd should be created nonblocking
1 parent 399d938 commit d013b71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/internal_linux.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import (
99
"unsafe"
1010
)
1111

12+
const (
13+
_EFD_NONBLOCK = 0x800
14+
)
15+
1216
// Poll ...
1317
type Poll struct {
1418
fd int // epoll fd
@@ -24,7 +28,7 @@ func OpenPoll() *Poll {
2428
panic(err)
2529
}
2630
l.fd = p
27-
r0, _, e0 := syscall.Syscall(syscall.SYS_EVENTFD2, 0, 0, 0)
31+
r0, _, e0 := syscall.Syscall(syscall.SYS_EVENTFD2, 0, _EFD_NONBLOCK, 0)
2832
if e0 != 0 {
2933
syscall.Close(p)
3034
panic(err)

0 commit comments

Comments
 (0)