forked from Archive/PX4-Autopilot
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…
Reference in New Issue