diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-18 09:56:23 +0100 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-18 09:56:23 +0100 |
commit | 48517ca661895a0c70093e78f165866cb9363206 (patch) | |
tree | a440e16a69b0a85cdb5663ba181a1c3ac2bf0bc5 /src/keeper.h | |
parent | 5f092fe0ec8b6942c63262e7c14c7e4ba913b023 (diff) | |
download | lanes-48517ca661895a0c70093e78f165866cb9363206.tar.gz lanes-48517ca661895a0c70093e78f165866cb9363206.tar.bz2 lanes-48517ca661895a0c70093e78f165866cb9363206.zip |
Lanes init crash fix
* bumped version to 3.9.1
* keeper array is allocated with master state's alloc function instead
of malloc()/free()
* prevent application crash when specifying a very large number of
keepers in the configuration options
* removed some keeper desinit legacy dead code
* any error occuring during one-time inits is raised outside the
one-time mutex protected code region
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/keeper.h b/src/keeper.h index ed11ec4..5a52f3b 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -8,15 +8,8 @@ struct s_Keeper | |||
8 | //int count; | 8 | //int count; |
9 | }; | 9 | }; |
10 | 10 | ||
11 | // if enabled, call close_keepers at the very last as we want to be sure no thread is GCing after. | 11 | int init_keepers( lua_State* L); |
12 | // (and therefore may perform linda object dereferencing after keepers are gone) | 12 | void close_keepers( lua_State* L); |
13 | // problem: maybe on some platforms (linux) atexit() is called after DLL/so are unloaded... | ||
14 | #define HAVE_KEEPER_ATEXIT_DESINIT 0 | ||
15 | |||
16 | char const* init_keepers( lua_State* L); | ||
17 | #if !HAVE_KEEPER_ATEXIT_DESINIT | ||
18 | void close_keepers( void); | ||
19 | #endif // HAVE_KEEPER_ATEXIT_DESINIT | ||
20 | 13 | ||
21 | struct s_Keeper *keeper_acquire( unsigned long magic_); | 14 | struct s_Keeper *keeper_acquire( unsigned long magic_); |
22 | #define KEEPER_MAGIC_SHIFT 3 | 15 | #define KEEPER_MAGIC_SHIFT 3 |