Changeset: bfc5d0e435c7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/bfc5d0e435c7 Modified Files: gdk/gdk_system.c Branch: Dec2023 Log Message:
Try to be saver: read pointer once, so that we don't suffer from races. We do assume that we get the complete value and that if the value is not NULL, it is and remains a valid pointer. Also, print type of object we're waiting for. diffs (26 lines): diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -280,15 +280,16 @@ dump_threads(void) char buf[1024]; thread_lock(); for (struct mtthread *t = mtthreads; t; t = t->next) { + MT_Lock *lk = t->lockwait; + MT_Sema *sm = t->semawait; + MT_Cond *cn = t->condwait; + struct mtthread *jn = t->joinwait; int pos = snprintf(buf, sizeof(buf), - "%s, tid %zu, waiting for %s, working on %.200s", + "%s, tid %zu, waiting for %s%s, working on %.200s", t->threadname, t->tid, - t->lockwait ? t->lockwait->name : - t->semawait ? t->semawait->name : - t->condwait ? t->condwait->name : - t->joinwait ? t->joinwait->threadname : - "nothing", + lk ? "lock " : sm ? "semaphore " : cn ? "condvar " : jn ? "thread " : "", + lk ? lk->name : sm ? sm->name : cn ? cn->name : jn ? jn->threadname : "nothing", ATOMIC_GET(&t->exited) ? "exiting" : t->working ? t->working : "nothing"); #ifdef LOCK_OWNER _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org