aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt period germain arrobase gmail period com>2014-02-26 11:53:30 +0100
committerBenoit Germain <bnt period germain arrobase gmail period com>2014-02-26 11:53:30 +0100
commitfe3c44e63f99538a02d42d2504ba405a6977ec0a (patch)
treeee369b7c44fb52b2030b784297e2b5ee788305c3 /src/keeper.h
parentd2bd8f65c678d898b6b7e5e92f76cb4dcce97b3c (diff)
downloadlanes-fe3c44e63f99538a02d42d2504ba405a6977ec0a.tar.gz
lanes-fe3c44e63f99538a02d42d2504ba405a6977ec0a.tar.bz2
lanes-fe3c44e63f99538a02d42d2504ba405a6977ec0a.zip
Multiverse compatibility
* bumped version to 3.9.2 * Internal rework: the whole Lanes engine now works "per universe" to allow concurrent Lanes execution in more than one embedded master state * this universe is a full userdata created in the master state, selfdestruct_gc is the __gc for this userdata * most of what was initialized only once is now per-universe * Fixed potential crashes at desinit if problems occur during keeper states initialisation * Fixed require() not always serialized properly * Raise an error instead of crashing on deep userdata prelude memory allocation failure * Added forgotten mutex desinitialisation at universe shutdown
Diffstat (limited to 'src/keeper.h')
-rw-r--r--src/keeper.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/keeper.h b/src/keeper.h
index 5a52f3b..450f64d 100644
--- a/src/keeper.h
+++ b/src/keeper.h
@@ -3,19 +3,25 @@
3 3
4struct s_Keeper 4struct s_Keeper
5{ 5{
6 MUTEX_T lock_; 6 MUTEX_T keeper_cs;
7 lua_State *L; 7 lua_State* L;
8 //int count; 8 //int count;
9}; 9};
10 10
11int init_keepers( lua_State* L); 11struct s_Keepers
12void close_keepers( lua_State* L); 12{
13 int nb_keepers;
14 struct s_Keeper keeper_array[1];
15};
16
17void init_keepers( struct s_Universe* U, lua_State* L);
18void close_keepers( struct s_Universe* U, lua_State* L);
13 19
14struct s_Keeper *keeper_acquire( unsigned long magic_); 20struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, unsigned long magic_);
15#define KEEPER_MAGIC_SHIFT 3 21#define KEEPER_MAGIC_SHIFT 3
16void keeper_release( struct s_Keeper* K); 22void keeper_release( struct s_Keeper* K);
17void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, enum eLookupMode const mode_); 23void keeper_toggle_nil_sentinels( lua_State* L, int _val_i, enum eLookupMode const mode_);
18int keeper_push_linda_storage( lua_State* L, void* ptr, unsigned long magic_); 24int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr, unsigned long magic_);
19 25
20typedef lua_CFunction keeper_api_t; 26typedef lua_CFunction keeper_api_t;
21#define KEEPER_API( _op) keepercall_ ## _op 27#define KEEPER_API( _op) keepercall_ ## _op
@@ -30,6 +36,6 @@ int keepercall_get( lua_State* L);
30int keepercall_set( lua_State* L); 36int keepercall_set( lua_State* L);
31int keepercall_count( lua_State* L); 37int keepercall_count( lua_State* L);
32 38
33int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); 39int keeper_call( struct s_Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, uint_t starting_index);
34 40
35#endif // __keeper_h__ \ No newline at end of file 41#endif // __keeper_h__ \ No newline at end of file