| 38 | static pthread_mutex_t sqlengine_pool_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 39 | |
| 40 | void sqlengine_thd_start(struct thdpool *pool, struct sqlthdstate *thd, |
| 41 | enum thrtype type) |
| 42 | { |
| 43 | backend_thread_event(thedb, COMDB2_THR_EVENT_START_RDWR); |
| 44 | |
| 45 | sql_mem_init(NULL); |
| 46 | |
| 47 | if (!gbl_use_appsock_as_sqlthread) |
| 48 | thd->thr_self = thrman_register(type); |
| 49 | |
| 50 | thd->logger = thrman_get_reqlogger(thd->thr_self); |
| 51 | thd->sqldb = NULL; |
| 52 | thd->sqldbx = NULL; |
| 53 | thd->stmt_cache = NULL; |
| 54 | thd->have_lastuser = 0; |
| 55 | thd->query_preparer_running = 0; |
| 56 | |
| 57 | start_sql_thread(); |
| 58 | |
| 59 | thd->sqlthd = pthread_getspecific(query_info_key); |
| 60 | rcache_init(bdb_attr_get(thedb->bdb_attr, BDB_ATTR_RCACHE_COUNT), |
| 61 | bdb_attr_get(thedb->bdb_attr, BDB_ATTR_RCACHE_PGSZ)); |
| 62 | } |
| 63 | |
| 64 | void sqlengine_thd_end(struct thdpool *pool, struct sqlthdstate *thd) |
| 65 | { |
no test coverage detected