Skip to content

Commit

Permalink
eventfd should be created nonblocking
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Feb 9, 2020
1 parent 399d938 commit d013b71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
"unsafe"
)

const (
_EFD_NONBLOCK = 0x800
)

// Poll ...
type Poll struct {
fd int // epoll fd
Expand All @@ -24,7 +28,7 @@ func OpenPoll() *Poll {
panic(err)
}
l.fd = p
r0, _, e0 := syscall.Syscall(syscall.SYS_EVENTFD2, 0, 0, 0)
r0, _, e0 := syscall.Syscall(syscall.SYS_EVENTFD2, 0, _EFD_NONBLOCK, 0)
if e0 != 0 {
syscall.Close(p)
panic(err)
Expand Down

0 comments on commit d013b71

Please sign in to comment.