AP_Mission: make all semaphores recursive

the cost is very similar and this prevents an easy coding error which
can occur on less used code paths
This commit is contained in:
Andrew Tridgell 2020-01-19 08:57:26 +11:00
parent 71a0645a59
commit 5ae6ad2a59
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ extern const AP_HAL::HAL& hal;
// storage object // storage object
StorageAccess AP_Mission::_storage(StorageManager::StorageMission); StorageAccess AP_Mission::_storage(StorageManager::StorageMission);
HAL_Semaphore_Recursive AP_Mission::_rsem; HAL_Semaphore AP_Mission::_rsem;
/// ///
/// public mission methods /// public mission methods

View File

@ -473,7 +473,7 @@ public:
// get a reference to the AP_Mission semaphore, allowing an external caller to lock the // get a reference to the AP_Mission semaphore, allowing an external caller to lock the
// storage while working with multiple waypoints // storage while working with multiple waypoints
HAL_Semaphore_Recursive &get_semaphore(void) { HAL_Semaphore &get_semaphore(void) {
return _rsem; return _rsem;
} }
@ -579,7 +579,7 @@ private:
// multi-thread support. This is static so it can be used from // multi-thread support. This is static so it can be used from
// const functions // const functions
static HAL_Semaphore_Recursive _rsem; static HAL_Semaphore _rsem;
// mission items common to all vehicles: // mission items common to all vehicles:
bool start_command_do_gripper(const AP_Mission::Mission_Command& cmd); bool start_command_do_gripper(const AP_Mission::Mission_Command& cmd);