aboutsummaryrefslogtreecommitdiff
path: root/src/tools.c
diff options
context:
space:
mode:
authorBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-11-29 20:33:46 +0100
committerBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-11-29 20:33:46 +0100
commitff74281fc94cda26b2d0a7fc2424f24fe2488718 (patch)
tree6e8aa44d300ccd5da451d02c08cee98090328b60 /src/tools.c
parentb4cd90c9e9a7898775d173df2267d1860dcbc699 (diff)
downloadlanes-ff74281fc94cda26b2d0a7fc2424f24fe2488718.tar.gz
lanes-ff74281fc94cda26b2d0a7fc2424f24fe2488718.tar.bz2
lanes-ff74281fc94cda26b2d0a7fc2424f24fe2488718.zip
supposedly improved pthread support
* bumped version to 3.7.3 * set pthread thread cancel type to PTHREAD_CANCEL_ASYNCHRONOUS * lane_h:cancel() accepts a 3rd timeout argument used when waiting for actual thread termination (hitting the timeout raises an error) * added PROPAGATE_ALLOCF macro to select state creation mode (lua_newstate or luaL_newstate)
Diffstat (limited to 'src/tools.c')
-rw-r--r--src/tools.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools.c b/src/tools.c
index 754605b..b5f2f4b 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -570,13 +570,14 @@ void populate_func_lookup_table( lua_State* L, int _i, char const* name_)
570lua_State* luaG_newstate( lua_State* _from, int const _on_state_create, char const* libs) 570lua_State* luaG_newstate( lua_State* _from, int const _on_state_create, char const* libs)
571{ 571{
572 // reuse alloc function from the originating state 572 // reuse alloc function from the originating state
573 void* allocUD; 573#if PROPAGATE_ALLOCF
574 lua_Alloc allocF = lua_getallocf( _from, &allocUD); 574 PROPAGATE_ALLOCF_PREP( _from);
575 lua_State* L = lua_newstate( allocF, allocUD); 575#endif // PROPAGATE_ALLOCF
576 lua_State* L = PROPAGATE_ALLOCF_ALLOC();
576 577
577 if( L == NULL) 578 if( L == NULL)
578 { 579 {
579 (void) luaL_error( _from, "'lua_newstate()' failed; out of memory"); 580 (void) luaL_error( _from, "luaG_newstate() failed while creating state; out of memory");
580 } 581 }
581 582
582 // we'll need this everytime we transfer some C function from/to this state 583 // we'll need this everytime we transfer some C function from/to this state