aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/keeper.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/keeper.c b/src/keeper.c
index 9a7c804..dbf083f 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -46,6 +46,7 @@
46#include "threading.h" 46#include "threading.h"
47#include "compat.h" 47#include "compat.h"
48#include "tools.h" 48#include "tools.h"
49#include "universe.h"
49#include "keeper.h" 50#include "keeper.h"
50 51
51//################################################################################### 52//###################################################################################
@@ -664,14 +665,11 @@ void init_keepers( struct s_Universe* U, lua_State* L)
664 // from there, GC can collect a linda, which would acquire the keeper again, and deadlock the thread. 665 // from there, GC can collect a linda, which would acquire the keeper again, and deadlock the thread.
665 // therefore, we need a recursive mutex. 666 // therefore, we need a recursive mutex.
666 MUTEX_RECURSIVE_INIT( &U->keepers->keeper_array[i].keeper_cs); 667 MUTEX_RECURSIVE_INIT( &U->keepers->keeper_array[i].keeper_cs);
667 STACK_CHECK( K);
668 668
669 // copy the universe pointer in the keeper itself 669 // copy the universe pointer in the keeper itself
670 lua_pushlightuserdata( K, UNIVERSE_REGKEY); 670 universe_store( K, U);
671 lua_pushlightuserdata( K, U);
672 lua_rawset( K, LUA_REGISTRYINDEX);
673 STACK_MID( K, 0);
674 671
672 STACK_CHECK( K);
675 // make sure 'package' is initialized in keeper states, so that we have require() 673 // make sure 'package' is initialized in keeper states, so that we have require()
676 // this because this is needed when transferring deep userdata object 674 // this because this is needed when transferring deep userdata object
677 luaL_requiref( K, "package", luaopen_package, 1); // package 675 luaL_requiref( K, "package", luaopen_package, 1); // package