diff options
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/keeper.h b/src/keeper.h index f7e3951..931c1d5 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -11,21 +11,23 @@ extern "C" { | |||
11 | #include "threading.h" | 11 | #include "threading.h" |
12 | #include "uniquekey.h" | 12 | #include "uniquekey.h" |
13 | 13 | ||
14 | #include <mutex> | ||
15 | |||
14 | // forwards | 16 | // forwards |
15 | enum class LookupMode; | 17 | enum class LookupMode; |
16 | struct Universe; | 18 | struct Universe; |
17 | 19 | ||
18 | struct Keeper | 20 | struct Keeper |
19 | { | 21 | { |
20 | MUTEX_T keeper_cs; | 22 | std::mutex m_mutex; |
21 | lua_State* L; | 23 | lua_State* L{ nullptr }; |
22 | // int count; | 24 | // int count; |
23 | }; | 25 | }; |
24 | 26 | ||
25 | struct Keepers | 27 | struct Keepers |
26 | { | 28 | { |
27 | int gc_threshold{ 0 }; | 29 | int gc_threshold{ 0 }; |
28 | int nb_keepers; | 30 | int nb_keepers{ 0 }; |
29 | Keeper keeper_array[1]; | 31 | Keeper keeper_array[1]; |
30 | }; | 32 | }; |
31 | 33 | ||
@@ -38,7 +40,7 @@ void close_keepers(Universe* U); | |||
38 | 40 | ||
39 | Keeper* which_keeper(Keepers* keepers_, uintptr_t magic_); | 41 | Keeper* which_keeper(Keepers* keepers_, uintptr_t magic_); |
40 | Keeper* keeper_acquire(Keepers* keepers_, uintptr_t magic_); | 42 | Keeper* keeper_acquire(Keepers* keepers_, uintptr_t magic_); |
41 | void keeper_release(Keeper* K); | 43 | void keeper_release(Keeper* K_); |
42 | void keeper_toggle_nil_sentinels(lua_State* L, int val_i_, LookupMode const mode_); | 44 | void keeper_toggle_nil_sentinels(lua_State* L, int val_i_, LookupMode const mode_); |
43 | int keeper_push_linda_storage(Universe* U, lua_State* L, void* ptr_, uintptr_t magic_); | 45 | int keeper_push_linda_storage(Universe* U, lua_State* L, void* ptr_, uintptr_t magic_); |
44 | 46 | ||