diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 16:07:55 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 16:07:55 -0300 |
commit | e8d4fe72366dd44e45ffd9fca09d92c3db4f8214 (patch) | |
tree | d9f28bbce22a50c9e1de2f239ee6584934afb510 /lstate.h | |
parent | b8691f13a8e3e9bb7fbd91d1f099eb517a9d5b35 (diff) | |
download | lua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.tar.gz lua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.tar.bz2 lua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.zip |
new macro `lua_threadyield' + lock stuff in `luaconf.h' + details
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 37 |
1 files changed, 3 insertions, 34 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.3 2004/05/14 19:25:09 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.4 2004/05/31 18:51:50 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 | */ |
@@ -14,30 +14,6 @@ | |||
14 | #include "lzio.h" | 14 | #include "lzio.h" |
15 | 15 | ||
16 | 16 | ||
17 | /* | ||
18 | ** macros for thread synchronization inside Lua core machine: | ||
19 | ** all accesses to the global state and to global objects are synchronized. | ||
20 | ** Because threads can read the stack of other threads | ||
21 | ** (when running garbage collection), | ||
22 | ** a thread must also synchronize any write-access to its own stack. | ||
23 | ** Unsynchronized accesses are allowed only when reading its own stack, | ||
24 | ** or when reading immutable fields from global objects | ||
25 | ** (such as string values and udata values). | ||
26 | */ | ||
27 | #ifndef lua_lock | ||
28 | #define lua_lock(L) ((void) 0) | ||
29 | #endif | ||
30 | |||
31 | #ifndef lua_unlock | ||
32 | #define lua_unlock(L) ((void) 0) | ||
33 | #endif | ||
34 | |||
35 | |||
36 | #ifndef lua_userstateopen | ||
37 | #define lua_userstateopen(l) | ||
38 | #endif | ||
39 | |||
40 | |||
41 | 17 | ||
42 | struct lua_longjmp; /* defined in ldo.c */ | 18 | struct lua_longjmp; /* defined in ldo.c */ |
43 | 19 | ||
@@ -74,15 +50,8 @@ typedef struct CallInfo { | |||
74 | StkId func; /* function index in the stack */ | 50 | StkId func; /* function index in the stack */ |
75 | StkId top; /* top for this function */ | 51 | StkId top; /* top for this function */ |
76 | int nresults; /* expected number of results from this function */ | 52 | int nresults; /* expected number of results from this function */ |
77 | union { | 53 | const Instruction *savedpc; |
78 | struct { /* for Lua functions */ | 54 | int tailcalls; /* number of tail calls lost under this entry */ |
79 | const Instruction *savedpc; | ||
80 | int tailcalls; /* number of tail calls lost under this entry */ | ||
81 | } l; | ||
82 | struct { /* for C functions */ | ||
83 | int dummy; /* just to avoid an empty struct */ | ||
84 | } c; | ||
85 | } u; | ||
86 | } CallInfo; | 55 | } CallInfo; |
87 | 56 | ||
88 | 57 | ||