mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-04 12:48:20 +00:00
examples/ostest: pthread clean-up test must call pthread_consistent, not pthread_mutex_unlock() on cancellation if robust mutexes are enabled.
This commit is contained in:
parent
64ad0684e7
commit
b580d494e8
1 changed files with 9 additions and 0 deletions
|
|
@ -60,12 +60,21 @@ static void cleanup(FAR void * data)
|
|||
FAR struct sync_s *sync = (FAR struct sync_s *) data;
|
||||
int status;
|
||||
|
||||
#ifdef CONFIG_PTHREAD_MUTEX_UNSAFE
|
||||
status = pthread_mutex_unlock(&sync->lock);
|
||||
if (status != 0)
|
||||
{
|
||||
printf("pthread_cleanup: ERROR pthread_mutex_unlock in cleanup handler. "
|
||||
"Status: %d\n", status);
|
||||
}
|
||||
#else
|
||||
status = pthread_mutex_consistent(&sync->lock);
|
||||
if (status != 0)
|
||||
{
|
||||
printf("pthread_cleanup: ERROR pthread_mutex_consistent in cleanup handler. "
|
||||
"Status: %d\n", status);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void *cleanup_thread(FAR void * data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue