This commit is contained in:
WolverinDEV 2019-07-02 01:59:52 +02:00
commit b11cc9a563
1 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@
#include <condition_variable>
#include <cassert>
#include <algorithm>
#include <src/misc/sassert.h>
#include "EventLoop.h"
using namespace std;
@ -177,7 +178,7 @@ void EventExecutor::_executor(event::EventExecutor *loop) {
} else {
loop->_threads.erase(index);
}
loop->should_adjust = (current_threads - 1) != loop->target_threads;
loop->should_adjust = ((current_threads - 1) != loop->target_threads);
} else {
loop->should_adjust = false;
}
@ -194,15 +195,15 @@ void EventExecutor::_executor(event::EventExecutor *loop) {
auto linked_entry = loop->head;
loop->head = linked_entry->next;
if(loop->head) {
assert(linked_entry == loop->head->previous);
sassert(linked_entry == loop->head->previous);
loop->head->previous = nullptr;
} else {
assert(linked_entry == loop->tail);
sassert(linked_entry == loop->tail);
loop->tail = nullptr;
}
auto event_handler = linked_entry->entry.lock();
assert(event_handler->_event_ptr == linked_entry);
sassert(event_handler->_event_ptr == linked_entry);
event_handler->_event_ptr = nullptr;
lock.unlock();