refactor(WorkQueue): move SignalWorkerThread out-of-line

Move the helper from the header into WorkQueue.cpp. Drop the
SignalWorkerThread() call from request_stop() — request_stop sets
_should_exit but the worker is woken up via the existing exit path
in Detach already, so the extra signal here is redundant.
This commit is contained in:
Julian Oes authored and Ramon Roche committed 2026-07-02 08:42:49 -07:00
1 parent 339291bec9
commit da52562708
2 files changed
+11 -9

No files matched your search

@@ -144,6 +144,15 @@ void WorkQueue::Add(WorkItem *item)
SignalWorkerThread();
}
void WorkQueue::SignalWorkerThread()
{
int sem_val;
if (px4_sem_getvalue(&_process_lock, &sem_val) == 0 && sem_val <= 0) {
px4_sem_post(&_process_lock);
}
}
void WorkQueue::Remove(WorkItem *item)
{
work_lock();