mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user