Skip to content

Commit

Permalink
kqueue: revert to v1.3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Feb 22, 2024
1 parent 407c9e4 commit 6d052f1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions poller_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,22 @@ 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 6d052f1

Please sign in to comment.