diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..6078e0f8c Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 000000000..c03dbc076 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/internal_modules/.DS_Store b/src/internal_modules/.DS_Store new file mode 100644 index 000000000..e137ebb25 Binary files /dev/null and b/src/internal_modules/.DS_Store differ diff --git a/src/internal_modules/roc_ctl/control_task_queue.cpp b/src/internal_modules/roc_ctl/control_task_queue.cpp index 40448db9d..7a98daeda 100644 --- a/src/internal_modules/roc_ctl/control_task_queue.cpp +++ b/src/internal_modules/roc_ctl/control_task_queue.cpp @@ -824,7 +824,7 @@ ControlTask* ControlTaskQueue::fetch_sleeping_task_() { return task; } -void ControlTaskQueue::insert_sleeping_task_(ControlTask& task) { +/*void ControlTaskQueue::insert_sleeping_task_(ControlTask& task) { roc_panic_if_not(task.effective_deadline_ > 0); ControlTask* pos = sleeping_queue_.front(); @@ -841,6 +841,17 @@ void ControlTaskQueue::insert_sleeping_task_(ControlTask& task) { sleeping_queue_.push_back(task); } } +*/ + + +// Define the priority queue for sleeping tasks with a std::greater comparator +std::priority_queue, std::greater<>> sleeping_queue_; + +void ControlTaskQueue::insert_sleeping_task_(ControlTask& task) { + roc_panic_if_not(task.effective_deadline_ > 0); + // Push the task into the priority queue + sleeping_queue_.push(&task); + } void ControlTaskQueue::remove_sleeping_task_(ControlTask& task) { roc_panic_if_not(task.effective_deadline_ > 0);