mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
pthreads: Re-order some operations so that mutexes are placed in the inconsistent state BEFORE the clean-up callbacks are called.
This commit is contained in:
@@ -119,7 +119,6 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
|
||||
/* The thread associated with the PID no longer exists */
|
||||
|
||||
mutex->pid = -1;
|
||||
mutex->flags &= _PTHREAD_MFLAGS_ROBUST;
|
||||
#ifdef CONFIG_PTHREAD_MUTEX_TYPES
|
||||
mutex->nlocks = 0;
|
||||
#endif
|
||||
@@ -132,6 +131,9 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear the inconsistent flag in any case */
|
||||
|
||||
mutex->flags &= _PTHREAD_MFLAGS_ROBUST;
|
||||
sched_unlock();
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user