From 3333a7244e9dc2c95c265650a8a236b7b0ddefe0 Mon Sep 17 00:00:00 2001 From: benoit-germain Date: Tue, 15 Nov 2011 17:20:08 +0100 Subject: crashfix: WIN32 builds shouldn't THREAD_WAIT on a THREAD_KILL'ed thread, (but pthread builds must still do it to make sure the thread is no longger running) --- src/lanes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lanes.c b/src/lanes.c index 40af6c0..676032a 100644 --- a/src/lanes.c +++ b/src/lanes.c @@ -1153,8 +1153,10 @@ static int selfdestruct_atexit( lua_State *L) if( !THREAD_ISNULL( s->thread)) // can be NULL if previous 'soft' termination succeeded { THREAD_KILL( &s->thread); - // make sure the thread is really stopped! +#if THREADAPI == THREADAPI_PTHREAD + // pthread: make sure the thread is really stopped! THREAD_WAIT( &s->thread, -1, &s->done_signal_, &s->done_lock_, &s->status); +#endif // THREADAPI == THREADAPI_PTHREAD } // NO lua_close() in this case because we don't know where execution of the state was interrupted #if THREADWAIT_METHOD == THREADWAIT_CONDVAR -- cgit v1.2.3-55-g6feb