trivial native mutex doc tweak.
PATCH 1/1 trivial native mutex doc tweak.
Attached, trivial patch for native rt_mutex_acquire function documentation. The reference to deprecated (and undocumented) rt_mutex_lock() & rt_mutex_release() is a little confusing.
Also updated the code snippets to match.
Regards, Paul.
skins/native/mutex.c +1 -1
@@ -297,7 +297,7 @@ int rt_mutex_delete(RT_MUTEX *mutex)* recursive and implement the priority inheritance protocol. * * Since a nested locking count is maintained for the current owner, -* rt_mutex_lock() and rt_mutex_unlock() must be used in pairs. +* rt_mutex_acquire() and rt_mutex_release() must be used in pairs. * * Tasks pend on mutexes by priority order. *
skins/native/snippets/mutex.c +2 -2
@@ -17,11 +17,11 @@ int main (int argc, char *argv[])/* Now, grab the mutex lock, run the critical section, then release the lock: */ -rt_mutex_lock (&mutex_desc,TM_INFINITE ); +rt_mutex_acquire (&mutex_desc,TM_INFINITE );/* ... Critical section ... */ -rt_mutex_unlock (&mutex_desc); +rt_mutex_release (&mutex_desc);/* ... */ }
skins/native/snippets/cond_var.c +4 -4
@@ -21,12 +21,12 @@ void foo (void)/* Now, wait for some task to post the shared event... */ -rt_mutex_lock (&mutex_desc,TM_INFINITE ); +rt_mutex_acquire (&mutex_desc,TM_INFINITE );while (!shared_event && !err) err =rt_cond_wait (&cond_desc,&mutex_desc,TM_INFINITE ); -rt_mutex_unlock (&mutex_desc); +rt_mutex_release (&mutex_desc);/* ... */ }
@@ -38,12 +38,12 @@ void bar (void)/* Post the shared event. */ -rt_mutex_lock (&mutex_desc,TM_INFINITE ); +rt_mutex_acquire (&mutex_desc,TM_INFINITE ); shared_event =1 ;rt_cond_signal (&cond_desc); -rt_mutex_unlock (&mutex_desc); +rt_mutex_release (&mutex_desc);/* ... */ }
Philippe Gerum
AppliedQuoted 5 lines · Paul
Attached, trivial patch for native
rt_mutex_acquirefunction documentation. The reference to deprecated (and undocumented)rt_mutex_lock()&rt_mutex_release()is a little confusing.Also updated the code snippets to match.
Merged, thanks.
Signature · 1 line
Philippe.