Skip to content

Commit

Permalink
Don't call delete readwrite operations in fiber_wait_read, fiber_wait…
Browse files Browse the repository at this point in the history
…_write.
  • Loading branch information
zhengshuxin committed Mar 27, 2024
1 parent 72ded83 commit 52f5824
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib_fiber/c/src/fiber_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,24 @@ int fiber_wait_read(FILE_EVENT *fe)
// If the IO has been canceled, we should try to remove the
// IO read event, because the wakeup process wasn't from
// read_callback normally.
#if 0
// Don't call event_del_read here, because it's a buffered
// delete read operation; We'll real delete read operation on
// the fd in event_close.
event_del_read(__thread_fiber->event, fe);
#endif
acl_fiber_set_error(curr->errnum);
return -1;
} else if (curr->flag & FIBER_F_TIMER) {
// If the IO reading timeout set in setsockopt.
// Clear FIBER_F_TIMER flag been set in wakeup_timers.
curr->flag &= ~FIBER_F_TIMER;
#if 0
// Don't call event_del_read here, because it's a buffered
// delete read operation; We'll real delete read operation on
// the fd in event_close.
event_del_read(__thread_fiber->event, fe);
#endif

acl_fiber_set_errno(curr, FIBER_EAGAIN);
acl_fiber_set_error(FIBER_EAGAIN);
Expand Down Expand Up @@ -575,12 +585,16 @@ int fiber_wait_write(FILE_EVENT *fe)
}

if (acl_fiber_canceled(curr)) {
#if 0
event_del_write(__thread_fiber->event, fe);
#endif
acl_fiber_set_error(curr->errnum);
return -1;
} else if (curr->flag & FIBER_F_TIMER) {
curr->flag &= ~FIBER_F_TIMER;
#if 0
event_del_write(__thread_fiber->event, fe);
#endif

acl_fiber_set_errno(curr, FIBER_EAGAIN);
acl_fiber_set_error(FIBER_EAGAIN);
Expand Down

0 comments on commit 52f5824

Please sign in to comment.