Skip to content

Commit

Permalink
remove active_events in async
Browse files Browse the repository at this point in the history
  • Loading branch information
qgymib committed Oct 7, 2023
1 parent 14b45cd commit 5268c01
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions ev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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" */
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/unix/async_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 5268c01

Please sign in to comment.