diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-12-16 14:40:07 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-12-16 14:40:07 -0200 |
| commit | a051b3323ef6d12677e78ec0a47d1731bd424d38 (patch) | |
| tree | 373d529a4df8d94f81f811dcef19627b5e30e2e5 /ldebug.c | |
| parent | c4e01c568aa498fbf141c13589c3cefdd7d9457e (diff) | |
| download | lua-a051b3323ef6d12677e78ec0a47d1731bd424d38.tar.gz lua-a051b3323ef6d12677e78ec0a47d1731bd424d38.tar.bz2 lua-a051b3323ef6d12677e78ec0a47d1731bd424d38.zip | |
comments (about hooks vs signals)
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 10 |
1 files changed, 8 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.116 2015/10/22 14:40:47 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.117 2015/11/02 18:48:07 roberto Exp roberto $ |
| 3 | ** Debug Interface | 3 | ** Debug Interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -69,7 +69,13 @@ static void swapextra (lua_State *L) { | |||
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | /* | 71 | /* |
| 72 | ** this function can be called asynchronous (e.g. during a signal) | 72 | ** This function can be called asynchronous (e.g. during a signal). |
| 73 | ** Fields 'oldpc', 'basehookcount', and 'hookcount' (set by | ||
| 74 | ** 'resethookcount') are for debug only, and it is no problem if they | ||
| 75 | ** get arbitrary values (causes at most one wrong hook call). 'hookmask' | ||
| 76 | ** is an atomic value. We assume that pointers are atomic too (e.g., gcc | ||
| 77 | ** ensures that for all platforms where it runs). Moreover, 'hook' is | ||
| 78 | ** always checked before being called (see 'luaD_hook'). | ||
| 73 | */ | 79 | */ |
| 74 | LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { | 80 | LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { |
| 75 | if (func == NULL || mask == 0) { /* turn off hooks? */ | 81 | if (func == NULL || mask == 0) { /* turn off hooks? */ |
