mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
pthreads: Backed most of last pthread changes. Found the 'real' root poblem. A one like error in pthread_mutex.c.
This commit is contained in:
@@ -55,18 +55,7 @@ static void rdlock_cleanup(FAR void *arg)
|
||||
{
|
||||
FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg;
|
||||
|
||||
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
|
||||
/* Check if this is a robust mutex in an inconsistent state */
|
||||
|
||||
if ((rw_lock->lock.flags & _PTHREAD_MFLAGS_INCONSISTENT) != 0)
|
||||
{
|
||||
(void)pthread_mutex_consistent(&rw_lock->lock);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,19 +56,7 @@ static void wrlock_cleanup(FAR void *arg)
|
||||
FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg;
|
||||
|
||||
rw_lock->num_writers--;
|
||||
|
||||
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
|
||||
/* Check if this is a robust mutex in an inconsistent state */
|
||||
|
||||
if ((rw_lock->lock.flags & _PTHREAD_MFLAGS_INCONSISTENT) != 0)
|
||||
{
|
||||
(void)pthread_mutex_consistent(&rw_lock->lock);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user