nuttx/sched/pthread
Gregory Nutt eb344d7260 Fix an assertion noted by Jussi Kivilinna.
This was a consequence of the recent robust mutex changes.  If robust mutexes are selected, then each mutex that a thread takes is retained in a list in threads TCB.  If the thread exits and that list is not empty, then we know that the thread exitted while holding mutexes.  And, in that case, each will be marked as inconsistent and the any waiter for the thread is awakened.

For the case of pthread_mutex_trywait(), the mutex was not being added to the list!  while not usually a fatal error, this was caught by an assertion when pthread_mutex_unlock() was called:  It tried to remove the mutex from the TCB list and it was not there when, of course, it shoule be.

The fix was to add pthread_mutex_trytake() which does sem_trywait() and if successful, does correctly add the mutext to the TCB list.  This should eliminated the assertion.
2017-03-29 07:50:40 -06:00
..
Make.defs pthreads: Add a configuration option to disable robust mutexes and revert to the traditional unsafe mutexes. 2017-03-26 17:37:28 -06:00
pthread_barrierdestroy.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_barrierinit.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_barrierwait.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_cancel.c pthreads: Add a configuration option to disable robust mutexes and revert to the traditional unsafe mutexes. 2017-03-26 17:37:28 -06:00
pthread_cleanup.c Add pthread_testcancel(), pthread_testcancel(), and definitiions for cancellation types. 2016-12-09 07:23:00 -06:00
pthread_completejoin.c pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not. 2017-03-26 11:22:17 -06:00
pthread_condbroadcast.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
pthread_conddestroy.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
pthread_condinit.c Update TODO. Provide do-nothing stubs for mutex attribute interfaces if features not enabled. pthread_cond includes a signaling semaphore and should call sem_setprotocol. 2016-11-05 11:06:52 -06:00
pthread_condsignal.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
pthread_condtimedwait.c Minor cleanup from recent changes. 2017-03-26 14:04:07 -06:00
pthread_condwait.c Minor cleanup from recent changes. 2017-03-26 14:04:07 -06:00
pthread_create.c pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not. 2017-03-26 11:22:17 -06:00
pthread_detach.c pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not. 2017-03-26 11:22:17 -06:00
pthread_exit.c pthreads: Add a configuration option to disable robust mutexes and revert to the traditional unsafe mutexes. 2017-03-26 17:37:28 -06:00
pthread_findjoininfo.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_getaffinity.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_getschedparam.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_getspecific.c
pthread_initialize.c pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not. 2017-03-26 11:22:17 -06:00
pthread_join.c pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not. 2017-03-26 11:22:17 -06:00
pthread_keycreate.c
pthread_keydelete.c
pthread_kill.c Add sig_raise() 2016-07-04 09:32:36 -06:00
pthread_mutex.c Fix an assertion noted by Jussi Kivilinna. 2017-03-29 07:50:40 -06:00
pthread_mutexconsistent.c Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES 2017-03-27 09:08:14 -06:00
pthread_mutexdestroy.c pthreads: Add more robustness characteristics: pthread_mutex_lock() and trylock() will now return EOWNERDEAD if the mutex is locked by a thread that no longer exists. Add pthread_mutex_consistent() to recover from this situation. 2017-03-26 10:35:23 -06:00
pthread_mutexinconsistent.c Forget to add some files in previous commits 2017-03-26 15:46:19 -06:00
pthread_mutexinit.c Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES 2017-03-27 09:08:14 -06:00
pthread_mutexlock.c Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES 2017-03-27 09:08:14 -06:00
pthread_mutextrylock.c Fix an assertion noted by Jussi Kivilinna. 2017-03-29 07:50:40 -06:00
pthread_mutexunlock.c Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES 2017-03-27 09:08:14 -06:00
pthread_once.c sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
pthread_release.c
pthread_setaffinity.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
pthread_setschedparam.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
pthread_setschedprio.c
pthread_setspecific.c
pthread_sigmask.c
pthread_yield.c
pthread.h Fix an assertion noted by Jussi Kivilinna. 2017-03-29 07:50:40 -06:00