Skip to content

Commit

Permalink
fix the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Aug 29, 2023
1 parent f9adb65 commit aca6f7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/dpp/event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,16 @@ template<class T> class event_router_t {
* @retval false if there are some listeners
*/
[[nodiscard]] bool empty() const {
std::shared_lock lock(mutex);
#ifdef DPP_CORO
std::shared_lock lock{mutex};
std::shared_lock coro_lock{coro_mutex};

return dispatch_container.empty() && coro_awaiters.empty();
#else
std::shared_lock lock{mutex};

return dispatch_container.empty();
#endif
}

/**
Expand Down

0 comments on commit aca6f7a

Please sign in to comment.