Small fix
This commit is contained in:
parent
d75455c63f
commit
c9e38d19ea
@ -3,6 +3,7 @@
|
|||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <src/misc/sassert.h>
|
||||||
#include "EventLoop.h"
|
#include "EventLoop.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -177,7 +178,7 @@ void EventExecutor::_executor(event::EventExecutor *loop) {
|
|||||||
} else {
|
} else {
|
||||||
loop->_threads.erase(index);
|
loop->_threads.erase(index);
|
||||||
}
|
}
|
||||||
loop->should_adjust = (current_threads - 1) != loop->target_threads;
|
loop->should_adjust = ((current_threads - 1) != loop->target_threads);
|
||||||
} else {
|
} else {
|
||||||
loop->should_adjust = false;
|
loop->should_adjust = false;
|
||||||
}
|
}
|
||||||
@ -194,15 +195,15 @@ void EventExecutor::_executor(event::EventExecutor *loop) {
|
|||||||
auto linked_entry = loop->head;
|
auto linked_entry = loop->head;
|
||||||
loop->head = linked_entry->next;
|
loop->head = linked_entry->next;
|
||||||
if(loop->head) {
|
if(loop->head) {
|
||||||
assert(linked_entry == loop->head->previous);
|
sassert(linked_entry == loop->head->previous);
|
||||||
loop->head->previous = nullptr;
|
loop->head->previous = nullptr;
|
||||||
} else {
|
} else {
|
||||||
assert(linked_entry == loop->tail);
|
sassert(linked_entry == loop->tail);
|
||||||
loop->tail = nullptr;
|
loop->tail = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto event_handler = linked_entry->entry.lock();
|
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;
|
event_handler->_event_ptr = nullptr;
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user