| 3317 | } |
| 3318 | |
| 3319 | static int join_threads(SP sp) |
| 3320 | { |
| 3321 | Lua L = sp->lua; |
| 3322 | dbthread_type *dbthd, *tmp; |
| 3323 | LIST_FOREACH_SAFE(dbthd, &sp->dbthds, entries, tmp) { |
| 3324 | LIST_REMOVE(dbthd, entries); |
| 3325 | if (dbthd->status != THREAD_STATUS_JOINED) { |
| 3326 | dbthread_join_int(L, dbthd); |
| 3327 | } |
| 3328 | free_dbthread_type(dbthd); |
| 3329 | } |
| 3330 | if (sp->wait_cond) { |
| 3331 | Pthread_cond_destroy(sp->wait_cond); |
| 3332 | Pthread_mutex_destroy(sp->wait_lock); |
| 3333 | free(sp->wait_cond); |
| 3334 | free(sp->wait_lock); |
| 3335 | sp->wait_cond = NULL; |
| 3336 | sp->wait_lock = NULL; |
| 3337 | } |
| 3338 | return 0; |
| 3339 | } |
| 3340 | |
| 3341 | static int dbstmt_free(Lua L) |
| 3342 | { |
no test coverage detected