static lv_State *getthread (lv_State *L, int *arg) { if (lv_isthread(L, 1)) { *arg = 1; return lv_tothread(L, 1); } else { *arg = 0; return L; } }
/** * @brief Get the thread associated with the given value * * It is considered a fatal error to call this function when the type of the * value is not a thread * * @param value the lua value which is a thread * @return the thread pointer */ struct lthread* lv_getthread(luav value, u32 argnum) { if (!lv_isthread(value)) { err_badtype(argnum, LTHREAD, lv_gettype(value)); } return (struct lthread*) lv_getptr(value); }