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:
Gregory Nutt
2017-04-10 09:51:03 -06:00
parent ec2a6e3721
commit 948332ca34
5 changed files with 18 additions and 39 deletions
+1 -12
View File
@@ -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
+1 -13
View File
@@ -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