diff options
author | benoit-germain <bnt.germain@gmail.com> | 2011-11-15 17:20:08 +0100 |
---|---|---|
committer | benoit-germain <bnt.germain@gmail.com> | 2011-11-15 17:20:08 +0100 |
commit | 3333a7244e9dc2c95c265650a8a236b7b0ddefe0 (patch) | |
tree | 373ab9c5e90079cea93b41addfda60abc034bbad /src/lanes.c | |
parent | 6bdf9c79111a34a6f54bb7edcd68ae86ca13daed (diff) | |
download | lanes-3333a7244e9dc2c95c265650a8a236b7b0ddefe0.tar.gz lanes-3333a7244e9dc2c95c265650a8a236b7b0ddefe0.tar.bz2 lanes-3333a7244e9dc2c95c265650a8a236b7b0ddefe0.zip |
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)
Diffstat (limited to 'src/lanes.c')
-rw-r--r-- | src/lanes.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
1153 | if( !THREAD_ISNULL( s->thread)) // can be NULL if previous 'soft' termination succeeded | 1153 | if( !THREAD_ISNULL( s->thread)) // can be NULL if previous 'soft' termination succeeded |
1154 | { | 1154 | { |
1155 | THREAD_KILL( &s->thread); | 1155 | THREAD_KILL( &s->thread); |
1156 | // make sure the thread is really stopped! | 1156 | #if THREADAPI == THREADAPI_PTHREAD |
1157 | // pthread: make sure the thread is really stopped! | ||
1157 | THREAD_WAIT( &s->thread, -1, &s->done_signal_, &s->done_lock_, &s->status); | 1158 | THREAD_WAIT( &s->thread, -1, &s->done_signal_, &s->done_lock_, &s->status); |
1159 | #endif // THREADAPI == THREADAPI_PTHREAD | ||
1158 | } | 1160 | } |
1159 | // NO lua_close() in this case because we don't know where execution of the state was interrupted | 1161 | // NO lua_close() in this case because we don't know where execution of the state was interrupted |
1160 | #if THREADWAIT_METHOD == THREADWAIT_CONDVAR | 1162 | #if THREADWAIT_METHOD == THREADWAIT_CONDVAR |