mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
Lock name should not equal locking function name. Urr.
This commit is contained in:
@@ -96,20 +96,20 @@ ORB_DEFINE(parameter_update, struct parameter_update_s);
|
|||||||
/** parameter update topic handle */
|
/** parameter update topic handle */
|
||||||
static orb_advert_t param_topic = -1;
|
static orb_advert_t param_topic = -1;
|
||||||
|
|
||||||
static sem_t param_lock = { .semcount = 1 };
|
static sem_t param_sem = { .semcount = 1 };
|
||||||
|
|
||||||
/** lock the parameter store */
|
/** lock the parameter store */
|
||||||
static void
|
static void
|
||||||
param_lock(void)
|
param_lock(void)
|
||||||
{
|
{
|
||||||
do {} while (sem_wait(¶m_lock) != 0);
|
do {} while (sem_wait(¶m_sem) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** unlock the parameter store */
|
/** unlock the parameter store */
|
||||||
static void
|
static void
|
||||||
param_unlock(void)
|
param_unlock(void)
|
||||||
{
|
{
|
||||||
sem_post(¶m_lock);
|
sem_post(¶m_sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** assert that the parameter store is locked */
|
/** assert that the parameter store is locked */
|
||||||
|
|||||||
Reference in New Issue
Block a user