More fixes to check if epoll_ctl fails.

This commit is contained in:
chris_kohlhoff 2005-09-24 10:57:08 +00:00
parent 59a9b76224
commit e6125c0614

View File

@ -331,7 +331,7 @@ private:
except_op_queue_.dispatch_cancellations();
bool stop = false;
while (!stop)
while (!stop && !stop_thread_)
{
int timeout = get_timeout();
wait_in_progress_ = true;
@ -400,7 +400,14 @@ private:
if (more_except)
ev.events |= EPOLLPRI;
ev.data.fd = descriptor;
epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev);
int result = epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev);
if (result != 0)
{
int error = errno;
read_op_queue_.dispatch_all_operations(descriptor, error);
write_op_queue_.dispatch_all_operations(descriptor, error);
except_op_queue_.dispatch_all_operations(descriptor, error);
}
}
}
}