aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lanes.c')
-rw-r--r--src/lanes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lanes.c b/src/lanes.c
index b65c6fa..262a497 100644
--- a/src/lanes.c
+++ b/src/lanes.c
@@ -1070,7 +1070,7 @@ volatile DEEP_PRELUDE *timer_deep; // = NULL
1070/* 1070/*
1071* Process end; cancel any still free-running threads 1071* Process end; cancel any still free-running threads
1072*/ 1072*/
1073static int selfdestruct_atexit( lua_State *L) 1073static int selfdestruct_gc( lua_State *L)
1074{ 1074{
1075 (void)L; // unused 1075 (void)L; // unused
1076 if (selfdestruct_first == SELFDESTRUCT_END) return 0; // no free-running threads 1076 if (selfdestruct_first == SELFDESTRUCT_END) return 0; // no free-running threads
@@ -1214,7 +1214,6 @@ static int selfdestruct_atexit( lua_State *L)
1214 DEBUGEXEC(fprintf( stderr, "Killed %d lane(s) at process end.\n", n )); 1214 DEBUGEXEC(fprintf( stderr, "Killed %d lane(s) at process end.\n", n ));
1215#endif 1215#endif
1216 } 1216 }
1217 close_keepers();
1218 return 0; 1217 return 0;
1219} 1218}
1220 1219
@@ -2363,7 +2362,6 @@ static void init_once_LOCKED( lua_State* L, volatile DEEP_PRELUDE** timer_deep_r
2363 // Selfdestruct chain handling 2362 // Selfdestruct chain handling
2364 // 2363 //
2365 MUTEX_INIT( &selfdestruct_cs ); 2364 MUTEX_INIT( &selfdestruct_cs );
2366 //atexit( selfdestruct_atexit );
2367 2365
2368 //--- 2366 //---
2369 // Linux needs SCHED_RR to change thread priorities, and that is only 2367 // Linux needs SCHED_RR to change thread priorities, and that is only
@@ -2421,7 +2419,7 @@ static void init_once_LOCKED( lua_State* L, volatile DEEP_PRELUDE** timer_deep_r
2421 { 2419 {
2422 lua_newuserdata( L, 1); 2420 lua_newuserdata( L, 1);
2423 lua_newtable( L); 2421 lua_newtable( L);
2424 lua_pushcfunction( L, selfdestruct_atexit); 2422 lua_pushcfunction( L, selfdestruct_gc);
2425 lua_setfield( L, -2, "__gc"); 2423 lua_setfield( L, -2, "__gc");
2426 lua_pushliteral( L, "AtExit"); 2424 lua_pushliteral( L, "AtExit");
2427 lua_setfield( L, -2, "__metatable"); 2425 lua_setfield( L, -2, "__metatable");