summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_cond.c10
-rw-r--r--lib/libthr/thread/thr_mutex.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c
index e48b121..5e26412 100644
--- a/lib/libthr/thread/thr_cond.c
+++ b/lib/libthr/thread/thr_cond.c
@@ -518,7 +518,15 @@ static void
cond_queue_enq(pthread_cond_t cond, pthread_t pthread)
{
pthread_t tid = TAILQ_LAST(&cond->c_queue, cond_head);
-
+ char *name;
+
+ name = pthread->name ? pthread->name : "unknown";
+ if ((pthread->flags & PTHREAD_FLAGS_IN_CONDQ) != 0)
+ _thread_printf(2, "Thread (%s:%u) already on condq\n",
+ pthread->name, pthread->uniqueid);
+ if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0)
+ _thread_printf(2, "Thread (%s:%u) already on mutexq\n",
+ pthread->name, pthread->uniqueid);
PTHREAD_ASSERT_NOT_IN_SYNCQ(pthread);
/*
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index de888e9..c6c80b4 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -1348,7 +1348,15 @@ static inline void
mutex_queue_enq(pthread_mutex_t mutex, pthread_t pthread)
{
pthread_t tid = TAILQ_LAST(&mutex->m_queue, mutex_head);
-
+ char *name;
+
+ name = pthread->name ? pthread->name : "unknown";
+ if ((pthread->flags & PTHREAD_FLAGS_IN_CONDQ) != 0)
+ _thread_printf(2, "Thread (%s:%u) already on condq\n",
+ pthread->name, pthread->uniqueid);
+ if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0)
+ _thread_printf(2, "Thread (%s:%u) already on mutexq\n",
+ pthread->name, pthread->uniqueid);
PTHREAD_ASSERT_NOT_IN_SYNCQ(pthread);
/*
* For the common case of all threads having equal priority,
OpenPOWER on IntegriCloud