diff --git a/server/src/server/VoiceIOManager.cpp b/server/src/server/VoiceIOManager.cpp index 985bcb6..c6d9d8c 100644 --- a/server/src/server/VoiceIOManager.cpp +++ b/server/src/server/VoiceIOManager.cpp @@ -38,7 +38,7 @@ std::shared_ptr VoiceIOManager::enableIo(server::TSServer *serv threads::MutexLock l(this->serverLock); this->servers.push_back(server_io); } - this->ioExecutorNotify.notify_all(); + this->ioExecutorNotify.notify_all(); return server_io; } @@ -306,7 +306,8 @@ void VoiceIOManager::dispatchBase(shared_ptr self) { { /* wait until reschedule */ unique_lock execute_lock(this->executorLock); - this->ioExecutorNotify.wait(execute_lock); + if(event_base_get_num_events(self->base, EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED | EVENT_BASE_COUNT_VIRTUAL) == 0) + this->ioExecutorNotify.wait(execute_lock); } } debugMessage(LOG_INSTANCE, "Dispatching io base {} finished", (void*) self->base);