Skip to content

Commit

Permalink
Merge pull request #360 from lesismal/master
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
lesismal authored Oct 27, 2023
2 parents d00806b + 6cf29cb commit 46edfa7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions poller_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ 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 | syscall.EV_CLEAR, Filter: syscall.EVFILT_READ})
p.mux.Unlock()
p.trigger()
}
Expand All @@ -117,7 +117,7 @@ func (p *poller) resetRead(fd int) {

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.eventList = append(p.eventList, syscall.Kevent_t{Ident: uint64(fd), Flags: syscall.EV_ADD | syscall.EV_CLEAR, Filter: syscall.EVFILT_WRITE})
p.mux.Unlock()
p.trigger()
}
Expand Down Expand Up @@ -229,7 +229,7 @@ func (p *poller) readWriteLoop() {
defer runtime.UnlockOSThread()
}

var events = make([]syscall.Kevent_t, 1024)
events := make([]syscall.Kevent_t, 1024)
var changes []syscall.Kevent_t

p.shutdown = false
Expand Down Expand Up @@ -319,5 +319,4 @@ func newPoller(g *Engine, isListener bool, index int) (*poller, error) {
}

func (c *Conn) ResetPollerEvent() {

}

0 comments on commit 46edfa7

Please sign in to comment.