Skip to content

Commit

Permalink
kqueue: revert to v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Feb 23, 2024
1 parent 422b237 commit 0aa4c4c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions poller_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,23 @@ func (p *poller) trigger() {
func (p *poller) addRead(fd int) {
p.mux.Lock()
p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_ADD, Filter: syscall.EVFILT_READ})
p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_ADD, Filter: syscall.EVFILT_WRITE})
p.mux.Unlock()
p.trigger()
}

func (p *poller) resetRead(fd int) {
p.mux.Lock()
p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_DELETE, Filter: syscall.EVFILT_WRITE})
p.mux.Unlock()
p.trigger()
// p.mux.Lock()
// p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_DELETE, Filter: syscall.EVFILT_WRITE})
// p.mux.Unlock()
// p.trigger()
}

func (p *poller) modWrite(fd int) {
p.mux.Lock()
p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_ADD, Filter: syscall.EVFILT_WRITE})
p.mux.Unlock()
p.trigger()
// p.mux.Lock()
// p.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_ADD, Filter: syscall.EVFILT_WRITE})
// p.mux.Unlock()
// p.trigger()
}

func (p *poller) deleteEvent(fd int) {
Expand Down

0 comments on commit 0aa4c4c

Please sign in to comment.