pthreads: Partial implementation of final part of robust mutexes: Keep list of all mutexes held by a thread in a list in the TCB.

This commit is contained in:
Gregory Nutt
2017-03-26 12:46:57 -06:00
parent 2c37d369ab
commit 6e623ce06f
9 changed files with 49 additions and 23 deletions
+9 -2
View File
@@ -136,8 +136,15 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex)
{
/* Increment the number of locks held and return successfully. */
mutex->nlocks++;
ret = OK;
if (mutex->nlocks < INT16_MAX)
{
mutex->nlocks++;
ret = OK;
}
else
{
ret = EOVERFLOW;
}
}
else
#endif