** 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) */
| 93 | ** access their other arguments) |
| 94 | */ |
| 95 | static lua_State *getthread (lua_State *L, int *arg) { |
| 96 | if (lua_isthread(L, 1)) { |
| 97 | *arg = 1; |
| 98 | return lua_tothread(L, 1); |
| 99 | } |
| 100 | else { |
| 101 | *arg = 0; |
| 102 | return L; /* function will operate over current thread */ |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | |
| 107 | /* |
no test coverage detected