Skip to content

Commit

Permalink
kqueue: fix write event
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Oct 19, 2023
1 parent eec9832 commit 6a21497
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions poller_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ func (p *poller) addRead(fd int) {
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_DISABLE, 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})
Expand Down

0 comments on commit 6a21497

Please sign in to comment.