mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 08:40:30 +08:00
px4_work_queue: add WorkItemSingleShot
To run a specific method on a work queue and wait for it to return.
This commit is contained in:
1 parent
87cd20180c
commit
8c41025565
5 files changed
+160
No files matched your search
@@ -50,6 +50,17 @@ WorkItem::WorkItem(const char *name, const wq_config_t &config) :
|
||||
}
|
||||
}
|
||||
|
||||
WorkItem::WorkItem(const char *name, const WorkItem &work_item) :
|
||||
_item_name(name)
|
||||
{
|
||||
px4::WorkQueue *wq = work_item._wq;
|
||||
|
||||
if ((wq != nullptr) && wq->Attach(this)) {
|
||||
_wq = wq;
|
||||
_start_time = hrt_absolute_time();
|
||||
}
|
||||
}
|
||||
|
||||
WorkItem::~WorkItem()
|
||||
{
|
||||
Deinit();
|
||||
|
||||
Reference in new issue
Block a user