Skip to content

Commit 7038bdc

Browse files
committed
Fix AIO task num overflow
1 parent bd033e5 commit 7038bdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/os/async_thread.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void swoole::async::ThreadPool::create_thread(const bool is_core_worker)
296296
{
297297
if (errno == EAGAIN)
298298
{
299-
swSocket_wait(SwooleTG.aio_pipe_write, 1000, SW_EVENT_WRITE);
299+
swSocket_wait(event->pipe_fd, 1000, SW_EVENT_WRITE);
300300
continue;
301301
}
302302
else if (errno == EINTR)
@@ -350,6 +350,7 @@ void swoole::async::ThreadPool::create_thread(const bool is_core_worker)
350350
event->object = new thread::id(this_thread::get_id());
351351
event->callback = aio_thread_release;
352352
event->pipe_fd = SwooleG.aio_default_pipe_fd;
353+
event->canceled = false;
353354

354355
--n_waiting;
355356
++n_closing;
@@ -488,7 +489,7 @@ int swAio_callback(swReactor *reactor, swEvent *event)
488489
AsyncEvent *event = events[i];
489490
if (!event->canceled)
490491
{
491-
event->callback(events[i]);
492+
event->callback(event);
492493
}
493494
SwooleTG.aio_task_num--;
494495
delete event;

0 commit comments

Comments
 (0)