aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt period germain arrobase gmail period com>2014-02-13 16:09:15 +0100
committerBenoit Germain <bnt period germain arrobase gmail period com>2014-02-13 16:09:15 +0100
commit32ad991eb8c590472607d61e9a831d2ca9db05c5 (patch)
tree1e3920223e81a5970241f9687db9129d7ec7bb2e /src/keeper.c
parentc38429579de57d338e0a1c14a7ed7b4aa90e059a (diff)
downloadlanes-32ad991eb8c590472607d61e9a831d2ca9db05c5.tar.gz
lanes-32ad991eb8c590472607d61e9a831d2ca9db05c5.tar.bz2
lanes-32ad991eb8c590472607d61e9a831d2ca9db05c5.zip
more fixes/tweaks about cancelled lindas
* bumped version to 3.8.5 * linda:limit() returns lanes.cancel_error on a limited linda * lanes.genlock() and lanes.genatomic() support cancelled lindas by returning lanes.cancel_error whenever appropriate * fixed a possible Lua stack overflow when calling linda:dump() * fixed cases where linda:send() and linda:receive() would not return lanes.cancel_error when they should
Diffstat (limited to 'src/keeper.c')
-rw-r--r--src/keeper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/keeper.c b/src/keeper.c
index 1a696aa..c22bfed 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -190,6 +190,7 @@ int keeper_push_linda_storage( lua_State* L, void* ptr)
190 struct s_Keeper* K = keeper_acquire( ptr); 190 struct s_Keeper* K = keeper_acquire( ptr);
191 lua_State* KL = K ? K->L : NULL; 191 lua_State* KL = K ? K->L : NULL;
192 if( KL == NULL) return 0; 192 if( KL == NULL) return 0;
193 STACK_GROW( KL, 4);
193 STACK_CHECK( KL); 194 STACK_CHECK( KL);
194 lua_pushlightuserdata( KL, fifos_key); // fifos_key 195 lua_pushlightuserdata( KL, fifos_key); // fifos_key
195 lua_rawget( KL, LUA_REGISTRYINDEX); // fifos 196 lua_rawget( KL, LUA_REGISTRYINDEX); // fifos
@@ -204,6 +205,7 @@ int keeper_push_linda_storage( lua_State* L, void* ptr)
204 } 205 }
205 // move data from keeper to destination state KEEPER MAIN 206 // move data from keeper to destination state KEEPER MAIN
206 lua_pushnil( KL); // storage nil 207 lua_pushnil( KL); // storage nil
208 STACK_GROW( L, 5);
207 STACK_CHECK( L); 209 STACK_CHECK( L);
208 lua_newtable( L); // out 210 lua_newtable( L); // out
209 while( lua_next( KL, -2)) // storage key fifo 211 while( lua_next( KL, -2)) // storage key fifo