aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/keeper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keeper.c b/src/keeper.c
index 9affbdf..418b5fb 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -599,7 +599,9 @@ char const* init_keepers( lua_State* L)
599 lua_rawset( K, LUA_REGISTRYINDEX); 599 lua_rawset( K, LUA_REGISTRYINDEX);
600 600
601 STACK_END( K, 0); 601 STACK_END( K, 0);
602 MUTEX_INIT( &GKeepers[i].lock_); 602 // we can trigger a GC from inside keeper_call(), where a keeper is acquired
603 // from there, GC can collect a linda, which would acquire the keeper again, and deadlock the thread.
604 MUTEX_RECURSIVE_INIT( &GKeepers[i].lock_);
603 GKeepers[i].L = K; 605 GKeepers[i].L = K;
604 } 606 }
605#if HAVE_KEEPER_ATEXIT_DESINIT 607#if HAVE_KEEPER_ATEXIT_DESINIT