diff options
author | benoit-germain <bnt.germain@gmail.com> | 2012-06-25 11:16:45 +0300 |
---|---|---|
committer | benoit-germain <bnt.germain@gmail.com> | 2012-06-25 11:16:45 +0300 |
commit | d076bec040618db19cecc05d952a90b78e248251 (patch) | |
tree | 71f4bcdfa3c9e746690c3b560c196472f7d944dd /src/lanes.c | |
parent | acfa2dff0d0c1158389c0a8883a560bf24ab4dcd (diff) | |
download | lanes-d076bec040618db19cecc05d952a90b78e248251.tar.gz lanes-d076bec040618db19cecc05d952a90b78e248251.tar.bz2 lanes-d076bec040618db19cecc05d952a90b78e248251.zip |
fix crash at application exit when encountering a blocked lane on which lane:cancel() has been called. (issue #28).
Diffstat (limited to 'src/lanes.c')
-rw-r--r-- | src/lanes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lanes.c b/src/lanes.c index b1c4018..eebe06a 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -1057,7 +1057,7 @@ static int selfdestruct_atexit( lua_State *L) | |||
1057 | while( s != SELFDESTRUCT_END ) | 1057 | while( s != SELFDESTRUCT_END ) |
1058 | { | 1058 | { |
1059 | // attempt a regular unforced cancel with a small timeout | 1059 | // attempt a regular unforced cancel with a small timeout |
1060 | bool_t cancelled = thread_cancel( s, 0.0001, FALSE); | 1060 | bool_t cancelled = THREAD_ISNULL( s->thread) || thread_cancel( s, 0.0001, FALSE); |
1061 | // if we failed, and we know the thread is waiting on a linda | 1061 | // if we failed, and we know the thread is waiting on a linda |
1062 | if( cancelled == FALSE && s->status == WAITING && s->waiting_on != NULL) | 1062 | if( cancelled == FALSE && s->status == WAITING && s->waiting_on != NULL) |
1063 | { | 1063 | { |