mirror of
https://github.com/KingDuckZ/incredis
synced 2024-11-27 00:43:50 +00:00
Optimization - I *think* it's correct.
This commit is contained in:
parent
657ecd63e2
commit
093d1dd198
1 changed files with 3 additions and 2 deletions
|
@ -204,9 +204,10 @@ namespace redis {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsyncConnection::wakeup_event_thread() {
|
void AsyncConnection::wakeup_event_thread() {
|
||||||
std::lock_guard<std::mutex> lock(m_local_data->libev_mutex);
|
if (ev_async_pending(&m_local_data->watcher_wakeup) == false) {
|
||||||
if (ev_async_pending(&m_local_data->watcher_wakeup) == false)
|
std::lock_guard<std::mutex> lock(m_local_data->libev_mutex);
|
||||||
ev_async_send(m_libev_loop_thread.get(), &m_local_data->watcher_wakeup);
|
ev_async_send(m_libev_loop_thread.get(), &m_local_data->watcher_wakeup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::mutex& AsyncConnection::event_mutex() {
|
std::mutex& AsyncConnection::event_mutex() {
|
||||||
|
|
Loading…
Reference in a new issue