diff options
-rw-r--r-- | src/lanes.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lanes.c b/src/lanes.c index aef023e..0873339 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -989,6 +989,11 @@ static void selfdestruct_remove( struct s_lane *s ) { | |||
989 | MUTEX_UNLOCK( &selfdestruct_cs ); | 989 | MUTEX_UNLOCK( &selfdestruct_cs ); |
990 | } | 990 | } |
991 | 991 | ||
992 | // Initialized by 'init_once_LOCKED()': the deep userdata Linda object | ||
993 | // used for timers (each lane will get a proxy to this) | ||
994 | // | ||
995 | volatile DEEP_PRELUDE *timer_deep; // = NULL | ||
996 | |||
992 | /* | 997 | /* |
993 | * Process end; cancel any still free-running threads | 998 | * Process end; cancel any still free-running threads |
994 | */ | 999 | */ |
@@ -1008,6 +1013,10 @@ static void selfdestruct_atexit( void ) { | |||
1008 | } | 1013 | } |
1009 | MUTEX_UNLOCK( &selfdestruct_cs ); | 1014 | MUTEX_UNLOCK( &selfdestruct_cs ); |
1010 | 1015 | ||
1016 | // Tell the timer thread to check it's cancel request | ||
1017 | struct s_Linda *td = timer_deep->deep; | ||
1018 | SIGNAL_ALL( &td->write_happened); | ||
1019 | |||
1011 | // When noticing their cancel, the lanes will remove themselves from | 1020 | // When noticing their cancel, the lanes will remove themselves from |
1012 | // the selfdestruct chain. | 1021 | // the selfdestruct chain. |
1013 | 1022 | ||
@@ -1954,11 +1963,6 @@ __declspec(dllexport) | |||
1954 | #endif | 1963 | #endif |
1955 | luaopen_lanes( lua_State *L ) { | 1964 | luaopen_lanes( lua_State *L ) { |
1956 | 1965 | ||
1957 | // Initialized by 'init_once_LOCKED()': the deep userdata Linda object | ||
1958 | // used for timers (each lane will get a proxy to this) | ||
1959 | // | ||
1960 | static volatile DEEP_PRELUDE *timer_deep; // = NULL | ||
1961 | |||
1962 | /* | 1966 | /* |
1963 | * Making one-time initializations. | 1967 | * Making one-time initializations. |
1964 | * | 1968 | * |