| 343 | } |
| 344 | |
| 345 | void |
| 346 | dbcontext::term_thread() |
| 347 | { |
| 348 | DBG_THR(fprintf(stderr, "HNDSOCK thread end %p\n", thd)); |
| 349 | close_tables_if(); |
| 350 | my_pthread_setspecific_ptr(THR_THD, 0); |
| 351 | { |
| 352 | #if MYSQL_VERSION_ID >= 50600 |
| 353 | remove_global_thread(thd); |
| 354 | #endif |
| 355 | |
| 356 | pthread_mutex_lock(&LOCK_thread_count); |
| 357 | #if MYSQL_VERSION_ID < 50600 |
| 358 | --thread_count; |
| 359 | #endif |
| 360 | delete thd; |
| 361 | thd = 0; |
| 362 | pthread_mutex_unlock(&LOCK_thread_count); |
| 363 | my_thread_end(); |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | bool |
| 368 | dbcontext::check_alive() |