From 5268c0110b4f480ff1acea974f2ff5dec607b20c Mon Sep 17 00:00:00 2001 From: qgymib Date: Sat, 7 Oct 2023 11:24:12 +0800 Subject: [PATCH] remove active_events in async --- ev.c | 21 +++++++++++++++------ src/unix/async_unix.c | 4 ++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ev.c b/ev.c index c40a01c32..1453b2cd4 100644 --- a/ev.c +++ b/ev.c @@ -244,8 +244,8 @@ EV_LOCAL void ev__async_exit_force(ev_async_t* handle); //////////////////////////////////////////////////////////////////////////////// // FILE: src/handle.h -// SIZE: 4353 -// SHA-256: 53260632044cb152f67e80b8a53ae58be5082b0345d8aebc8705fc233387401d +// SIZE: 4489 +// SHA-256: 91b25563a3081fd298b2b24aa7b7ac750f79050050edd9b39a2b80e65de91073 //////////////////////////////////////////////////////////////////////////////// #line 1 "src/handle.h" #ifndef __EV_HANDLE_INTERNAL_H__ @@ -310,7 +310,16 @@ EV_LOCAL void ev__handle_init(ev_loop_t* loop, ev_handle_t* handle, ev_role_t ro */ EV_LOCAL void ev__handle_exit(ev_handle_t* handle, ev_handle_cb close_cb); +/** + * @brief Active handle. + * @param[in] handle Handler. + */ EV_LOCAL void ev__handle_active(ev_handle_t* handle); + +/** + * @brief De-active handle. + * @param[in] handle Handler. + */ EV_LOCAL void ev__handle_deactive(ev_handle_t* handle); /** @@ -12831,8 +12840,8 @@ EV_LOCAL void ev__exit_work(ev_loop_t* loop); //////////////////////////////////////////////////////////////////////////////// // FILE: src/unix/async_unix.c -// SIZE: 3433 -// SHA-256: e161c8b4fa0221c961d0bedf0f54df72fb2a29c3ac0f6407ad03af284fe4232a +// SIZE: 3429 +// SHA-256: 2b3cd7bedadfea909b1fa93ecfe5b2708fa954a3d27c2e76cb1ac0e55b29241e //////////////////////////////////////////////////////////////////////////////// #line 1 "src/unix/async_unix.c" /* AMALGAMATE: #include "ev.h" */ @@ -12885,7 +12894,7 @@ static void _ev_async_exit(ev_async_t* handle, ev_async_cb close_cb) handle->close_cb = close_cb; _async_close_pipe(handle); - ev__handle_event_dec(&handle->base); + ev__handle_deactive(&handle->base); ev__handle_exit(&handle->base, close_cb != NULL ? _ev_async_on_close : NULL); } @@ -12979,7 +12988,7 @@ int ev_async_init(ev_loop_t* loop, ev_async_t* handle, ev_async_cb cb) ev__nonblock_io_init(&handle->backend.io, handle->backend.pipfd[0], _async_on_wakeup_unix, NULL); ev__nonblock_io_add(loop, &handle->backend.io, EV_IO_IN); - ev__handle_event_add(&handle->base); + ev__handle_active(&handle->base); return 0; diff --git a/src/unix/async_unix.c b/src/unix/async_unix.c index 2e1e64a10..a7459dfd1 100644 --- a/src/unix/async_unix.c +++ b/src/unix/async_unix.c @@ -48,7 +48,7 @@ static void _ev_async_exit(ev_async_t* handle, ev_async_cb close_cb) handle->close_cb = close_cb; _async_close_pipe(handle); - ev__handle_event_dec(&handle->base); + ev__handle_deactive(&handle->base); ev__handle_exit(&handle->base, close_cb != NULL ? _ev_async_on_close : NULL); } @@ -142,7 +142,7 @@ int ev_async_init(ev_loop_t* loop, ev_async_t* handle, ev_async_cb cb) ev__nonblock_io_init(&handle->backend.io, handle->backend.pipfd[0], _async_on_wakeup_unix, NULL); ev__nonblock_io_add(loop, &handle->backend.io, EV_IO_IN); - ev__handle_event_add(&handle->base); + ev__handle_active(&handle->base); return 0;