mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-25 07:49:18 +00:00
Enclose all code for macro ENQUEUE_MUTEX in do while statement, and
add missing brackets. MFC: after 1 day
This commit is contained in:
parent
f5ae94753b
commit
6a663207e7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174535
@ -296,13 +296,15 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
|
||||
|
||||
#define ENQUEUE_MUTEX(curthread, m) \
|
||||
m->m_owner = curthread; \
|
||||
do { \
|
||||
(m)->m_owner = curthread; \
|
||||
/* Add to the list of owned mutexes: */ \
|
||||
MUTEX_ASSERT_NOT_OWNED(m); \
|
||||
if ((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) \
|
||||
TAILQ_INSERT_TAIL(&curthread->mutexq, m, m_qe); \
|
||||
MUTEX_ASSERT_NOT_OWNED((m)); \
|
||||
if (((m)->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) \
|
||||
TAILQ_INSERT_TAIL(&curthread->mutexq, (m), m_qe);\
|
||||
else \
|
||||
TAILQ_INSERT_TAIL(&curthread->pp_mutexq, m, m_qe)
|
||||
TAILQ_INSERT_TAIL(&curthread->pp_mutexq, (m), m_qe);\
|
||||
} while (0)
|
||||
|
||||
static int
|
||||
mutex_trylock_common(struct pthread *curthread, pthread_mutex_t *mutex)
|
||||
|
Loading…
Reference in New Issue
Block a user