Small fix

This commit is contained in:
WolverinDEV 2019-07-02 01:35:25 +02:00
parent d75455c63f
commit c9e38d19ea

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();