diff options
author | Benoit 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 |
---|---|---|
committer | Benoit 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 |
commit | ff74281fc94cda26b2d0a7fc2424f24fe2488718 (patch) | |
tree | 6e8aa44d300ccd5da451d02c08cee98090328b60 /src/tools.h | |
parent | b4cd90c9e9a7898775d173df2267d1860dcbc699 (diff) | |
download | lanes-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.h')
-rw-r--r-- | src/tools.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools.h b/src/tools.h index e984ec2..19dca70 100644 --- a/src/tools.h +++ b/src/tools.h | |||
@@ -41,6 +41,17 @@ void luaL_requiref (lua_State* L, const char* modname, lua_CFunction openf, int | |||
41 | #define luaG_registerlibfuncs( L, _funcs) luaL_setfuncs( L, _funcs, 0) | 41 | #define luaG_registerlibfuncs( L, _funcs) luaL_setfuncs( L, _funcs, 0) |
42 | #endif // LUA_VERSION_NUM == 502 | 42 | #endif // LUA_VERSION_NUM == 502 |
43 | 43 | ||
44 | // For some reason, LuaJIT 64bits doesn't support lua_newstate() | ||
45 | // If you build specifically for this situation, change value to 0 | ||
46 | #define PROPAGATE_ALLOCF 1 | ||
47 | #if PROPAGATE_ALLOCF | ||
48 | #define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) | ||
49 | #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) | ||
50 | #else // PROPAGATE_ALLOCF | ||
51 | #define PROPAGATE_ALLOCF_PREP( L) | ||
52 | #define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() | ||
53 | #endif // PROPAGATE_ALLOCF | ||
54 | |||
44 | #define USE_DEBUG_SPEW 0 | 55 | #define USE_DEBUG_SPEW 0 |
45 | #if USE_DEBUG_SPEW | 56 | #if USE_DEBUG_SPEW |
46 | extern char const* debugspew_indent; | 57 | extern char const* debugspew_indent; |