mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-24 16:01:53 +08:00
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:
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();
|
||||
|
||||
Reference in new issue
Block a user