aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-02 16:07:55 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-02 16:07:55 -0300
commite8d4fe72366dd44e45ffd9fca09d92c3db4f8214 (patch)
treed9f28bbce22a50c9e1de2f239ee6584934afb510 /luaconf.h
parentb8691f13a8e3e9bb7fbd91d1f099eb517a9d5b35 (diff)
downloadlua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.tar.gz
lua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.tar.bz2
lua-e8d4fe72366dd44e45ffd9fca09d92c3db4f8214.zip
new macro `lua_threadyield' + lock stuff in `luaconf.h' + details
Diffstat (limited to 'luaconf.h')
-rw-r--r--luaconf.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/luaconf.h b/luaconf.h
index 476b8bc1..93793e55 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.4 2004/05/28 18:32:51 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.5 2004/06/02 13:24:43 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -215,6 +215,32 @@
215#endif 215#endif
216 216
217 217
218
219/*
220** macros for thread synchronization inside Lua core machine:
221** all accesses to the global state and to global objects are synchronized.
222** Because threads can read the stack of other threads
223** (when running garbage collection),
224** a thread must also synchronize any write-access to its own stack.
225** Unsynchronized accesses are allowed only when reading its own stack,
226** or when reading immutable fields from global objects
227** (such as string values and udata values).
228*/
229#define lua_lock(L) ((void) 0)
230#define lua_unlock(L) ((void) 0)
231
232/*
233** this macro allows a thread switch in appropriate places in the Lua
234** core
235*/
236#define lua_threadyield(L) {lua_unlock(L); lua_lock(L);}
237
238
239
240/* allows user-specific initialization on new threads */
241#define lua_userstateopen(l) /* empty */
242
243
218#endif 244#endif
219 245
220/* }====================================================== */ 246/* }====================================================== */