mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 00:27:52 +01:00
Cleanup task_waker a bit more
This commit is contained in:
@@ -237,12 +237,10 @@ static void task_waker() {
|
||||
|
||||
while (WaitingTasks.begin() != WaitingTasks.end() && WaitingTasks.begin()->first <= micros && WaitingTasks.begin()->second->val->state() != Task::TaskState::TS_RUNNING) {
|
||||
auto node = WaitingTasks.begin();
|
||||
// FIXME:
|
||||
auto node2 = node;
|
||||
++node2;
|
||||
auto task = WaitingTasks.begin()->second;
|
||||
|
||||
WaitingTasks.erase(node, node2);
|
||||
auto task = node->second;
|
||||
|
||||
WaitingTasks.erase(node);
|
||||
|
||||
WaitingTasks_mlock.unlock();
|
||||
|
||||
@@ -256,11 +254,6 @@ static void task_waker() {
|
||||
|
||||
WaitingTasks_mlock.lock();
|
||||
}
|
||||
WaitingTasks_mlock.unlock();
|
||||
}
|
||||
{
|
||||
// TODO: this is ugly
|
||||
WaitingTasks_mlock.lock();
|
||||
WaitingTasks_cv.wait(WaitingTasks_mlock);
|
||||
WaitingTasks_mlock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user