mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
px4_shutdown_unlock: check that counter is > 0
This commit is contained in:
parent
007b6dd8d7
commit
c5a1d1928d
@ -66,7 +66,13 @@ int px4_shutdown_unlock()
|
||||
int ret = pthread_mutex_lock(&shutdown_mutex);
|
||||
|
||||
if (ret == 0) {
|
||||
--shutdown_lock_counter;
|
||||
if (shutdown_lock_counter > 0) {
|
||||
--shutdown_lock_counter;
|
||||
|
||||
} else {
|
||||
PX4_ERR("unmatched number of px4_shutdown_unlock() calls");
|
||||
}
|
||||
|
||||
return pthread_mutex_unlock(&shutdown_mutex);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user