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

Function dbthread_join_int

lua/sp.c:3284–3299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3282}
3283
3284static void dbthread_join_int(Lua L, dbthread_type *dbthd)
3285{
3286 pthread_mutex_t *mtx = &dbthd->lua_thread_mutex;
3287 pthread_cond_t *cond = &dbthd->lua_thread_cond;
3288 Pthread_mutex_lock(mtx);
3289 while (dbthd->status == THREAD_STATUS_DISPATCH_WAITING ||
3290 dbthd->status == THREAD_STATUS_RUNNING) {
3291 check_retry_conditions(L, NULL, 1);
3292 struct timespec ts;
3293 clock_gettime(CLOCK_REALTIME, &ts);
3294 ts.tv_sec += 1;
3295 pthread_cond_timedwait(cond, mtx, &ts);
3296 }
3297 dbthd->status = THREAD_STATUS_JOINED;
3298 Pthread_mutex_unlock(mtx);
3299}
3300
3301static int dbthread_join(Lua lua1)
3302{

Callers 2

dbthread_joinFunction · 0.85
join_threadsFunction · 0.85

Calls 1

check_retry_conditionsFunction · 0.85

Tested by

no test coverage detected