@@ -53,10 +53,9 @@ const (
53
53
54
54
// fdDesc contains all data structures associated to fd
55
55
type fdDesc struct {
56
- readers list.List // all read/write requests
57
- writers list.List
58
- ptr uintptr // pointer to net.Conn
59
- armState uint8
56
+ readers list.List // all read/write requests
57
+ writers list.List
58
+ ptr uintptr // pointer to net.Conn
60
59
}
61
60
62
61
// watcher will monitor events and process async-io request(s),
@@ -650,7 +649,6 @@ func (w *watcher) handlePending(pending []*aiocb) {
650
649
}
651
650
652
651
// as the file descriptor is registered, we can proceed to IO operations
653
- currentState := desc .armState
654
652
switch pcb .op {
655
653
case OpRead :
656
654
// if there's no pending read requests
@@ -666,7 +664,6 @@ func (w *watcher) handlePending(pending []*aiocb) {
666
664
// if the request is not fulfilled, we should queue it
667
665
pcb .l = & desc .readers
668
666
pcb .elem = pcb .l .PushBack (pcb )
669
- currentState |= ARM_READ
670
667
671
668
case OpWrite :
672
669
if desc .writers .Len () == 0 {
@@ -678,13 +675,6 @@ func (w *watcher) handlePending(pending []*aiocb) {
678
675
679
676
pcb .l = & desc .writers
680
677
pcb .elem = pcb .l .PushBack (pcb )
681
- currentState |= ARM_WRITE
682
- }
683
-
684
- // state changed, try rearm descriptor
685
- if currentState != desc .armState {
686
- desc .armState = currentState
687
- w .pfd .Rearm (ident , desc .armState & ARM_READ != 0 , desc .armState & ARM_WRITE != 0 )
688
678
}
689
679
690
680
// if the request has deadline set, we should push it to timeout heap
@@ -710,7 +700,6 @@ func (w *watcher) handleEvents(pe pollerEvents) {
710
700
//log.Println(e)
711
701
for _ , e := range pe {
712
702
if desc , ok := w .descs [e .ident ]; ok {
713
- desc .armState = 0
714
703
if e .ev & EV_READ != 0 {
715
704
var next * list.Element
716
705
// try to complete all read requests
@@ -727,10 +716,6 @@ func (w *watcher) handleEvents(pe pollerEvents) {
727
716
}
728
717
729
718
}
730
- // if there's still read requests pending, rearm.
731
- if desc .readers .Len () > 0 {
732
- desc .armState |= ARM_READ
733
- }
734
719
735
720
if e .ev & EV_WRITE != 0 {
736
721
var next * list.Element
@@ -746,15 +731,6 @@ func (w *watcher) handleEvents(pe pollerEvents) {
746
731
}
747
732
748
733
}
749
- if desc .writers .Len () > 0 {
750
- desc .armState |= ARM_WRITE
751
- }
752
-
753
- // rearm
754
- if desc .armState != 0 {
755
- w .pfd .Rearm (e .ident , desc .armState & ARM_READ != 0 , desc .armState & ARM_WRITE != 0 )
756
- }
757
734
}
758
735
}
759
-
760
736
}
0 commit comments