MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / db_create_thread

Function db_create_thread

lua/sp.c:3808–3835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3806}
3807
3808static int db_create_thread(Lua L)
3809{
3810 // ...
3811 // funcarg2
3812 // funcarg1
3813 // func
3814 // db
3815
3816 luaL_checkudata(L, 1, dbtypes.db);
3817 lua_remove(L, 1);
3818
3819 luaL_checktype(L, 1, LUA_TFUNCTION);
3820 lua_getglobal(L, "_SP");
3821 lua_getfield(L, -1, "cdb2_func_refs");
3822 lua_remove(L, -2); // _SP
3823
3824 lua_pushvalue(L, 1); // key for lookup is func; move to top
3825 lua_remove(L, 1);
3826 lua_gettable(L, -2);
3827
3828 const char *funcname = lua_tostring(L, -1);
3829 lua_pop(L, 2); // string, cdb2_func_refs
3830
3831 // ...
3832 // funcarg2
3833 // funcarg1
3834 return db_create_thread_int(L, funcname);
3835}
3836
3837static int db_table(lua_State *lua)
3838{

Callers

nothing calls this directly

Calls 7

luaL_checkudataFunction · 0.85
lua_removeFunction · 0.85
luaL_checktypeFunction · 0.85
lua_getfieldFunction · 0.85
lua_pushvalueFunction · 0.85
lua_gettableFunction · 0.85
db_create_thread_intFunction · 0.85

Tested by

no test coverage detected