From 7934a71c7052bb2e5b391fd5370faba577713502 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 14 Feb 2015 15:45:12 -0800 Subject: [PATCH] nonlib/Thread: Don't clear _thread in exit(), because join() will need it later. Closes: #134 --- nonlib/Thread.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonlib/Thread.C b/nonlib/Thread.C index f0c6292..acee63f 100644 --- a/nonlib/Thread.C +++ b/nonlib/Thread.C @@ -124,9 +124,11 @@ Thread::join ( void ) _thread = 0; } +/* never call this unless some other thread will be calling 'join' on + * this one, otherwise, running() will return true even though the + * thread is dead */ void Thread::exit ( void *retval ) { - _thread = 0; pthread_exit( retval ); }