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

Function dbthread_join

lua/sp.c:3301–3317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3299}
3300
3301static int dbthread_join(Lua lua1)
3302{
3303 dbthread_type *dbthd = ((dbthread_t *)lua_touserdata(lua1, -1))->dbthd;
3304 if (dbthd->status == THREAD_STATUS_JOINED) {
3305 return 0;
3306 }
3307 if (dbthd->status == THREAD_STATUS_DISPATCH_FAILED) {
3308 dbthread_join_int(lua1, dbthd);
3309 return 0;
3310 }
3311 dbthread_join_int(lua1, dbthd);
3312 SP sp2 = dbthd->clnt.sp;
3313 Lua lua2 = sp2->lua;
3314 int num_returns = copy_state_stacks(lua2, lua1, 0);
3315 if (sp2->error) strncpy(dbthd->error, sp2->error, sizeof(dbthd->error) - 1);
3316 return num_returns;
3317}
3318
3319static int join_threads(SP sp)
3320{

Callers

nothing calls this directly

Calls 3

lua_touserdataFunction · 0.85
dbthread_join_intFunction · 0.85
copy_state_stacksFunction · 0.85

Tested by

no test coverage detected