summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libthr/thread/thr_exit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c
index 4cd581e..0dc7e2d 100644
--- a/lib/libthr/thread/thr_exit.c
+++ b/lib/libthr/thread/thr_exit.c
@@ -286,6 +286,8 @@ exit_thread(void)
curthread->cycle++;
_thr_umtx_wake(&curthread->cycle, INT_MAX, 0);
}
+ if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
+ _thr_report_death(curthread);
/*
* Thread was created with initial refcount 1, we drop the
* reference count to allow it to be garbage collected.
@@ -293,9 +295,6 @@ exit_thread(void)
curthread->refcount--;
_thr_try_gc(curthread, curthread); /* thread lock released */
- if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
- _thr_report_death(curthread);
-
#if defined(_PTHREADS_INVARIANTS)
if (THR_IN_CRITICAL(curthread))
PANIC("thread exits with resources held!");
OpenPOWER on IntegriCloud