diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-24 13:45:33 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-24 13:45:33 -0200 |
commit | 71ae4801d66d9592b0fb08e4e78138b7a6e993d5 (patch) | |
tree | a683b5b3757efb979329bf513f1bd9fde3fb9d1f /lstate.h | |
parent | 6fda6a530265268c01a83c31f8fc30e34753bbf1 (diff) | |
download | lua-71ae4801d66d9592b0fb08e4e78138b7a6e993d5.tar.gz lua-71ae4801d66d9592b0fb08e4e78138b7a6e993d5.tar.bz2 lua-71ae4801d66d9592b0fb08e4e78138b7a6e993d5.zip |
macros LUA_ENTRY/LUA_EXIT to control exclusive access to Lua core
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 1.44 2001/01/19 13:20:30 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 1.45 2001/01/22 18:01:38 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -13,6 +13,26 @@ | |||
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | #ifdef LUA_DEBUG | ||
17 | extern int islocked; | ||
18 | #define LUA_ENTRY lua_assert(islocked++ == 0) | ||
19 | #define LUA_EXIT lua_assert(--islocked == 0) | ||
20 | #endif | ||
21 | |||
22 | |||
23 | /* | ||
24 | ** macros that control all entries and exits from Lua core machine | ||
25 | ** (mainly for thread syncronization) | ||
26 | */ | ||
27 | #ifndef LUA_ENTRY | ||
28 | #define LUA_ENTRY | ||
29 | #endif | ||
30 | |||
31 | #ifndef LUA_EXIT | ||
32 | #define LUA_EXIT | ||
33 | #endif | ||
34 | |||
35 | |||
16 | typedef TObject *StkId; /* index to stack elements */ | 36 | typedef TObject *StkId; /* index to stack elements */ |
17 | 37 | ||
18 | 38 | ||