| 3282 | } |
| 3283 | |
| 3284 | static 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 | |
| 3301 | static int dbthread_join(Lua lua1) |
| 3302 | { |
no test coverage detected