From 7a6f726ddcf5d20758d607993ef33aa8fbd11d96 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 30 Sep 2019 14:16:44 +0000 Subject: [PATCH] MFC r352620, MFS12 r352892: Fix destruction of the robust mutexes. Approved by: re (gjb) --- lib/libthr/thread/thr_mutex.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index dc09f539add..57984ef6d0e 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -474,7 +474,11 @@ _thr_mutex_destroy(pthread_mutex_t *mutex) if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(_get_curthread(), m1); + if ((uint32_t)m1->m_lock.m_owner != + UMUTEX_RB_OWNERDEAD) { + mutex_assert_not_owned( + _get_curthread(), m1); + } __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED;