** Auxiliary function used by several library functions: check for ** an optional thread as function's first argument and set 'arg' with ** 1 if this argument is present (so that functions can skip it to ** access their other arguments) */
| 87 | ** access their other arguments) |
| 88 | */ |
| 89 | static lua_State *getthread(lua_State *L, int *arg) { |
| 90 | if (lua_isthread(L, 1)) { |
| 91 | *arg = 1; |
| 92 | return lua_tothread(L, 1); |
| 93 | } |
| 94 | else { |
| 95 | *arg = 0; |
| 96 | return L; /* function will operate over current thread */ |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | |
| 101 | /* |
no test coverage detected