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

Function sqlengine_thd_start

db/sqlpool.c:40–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38static pthread_mutex_t sqlengine_pool_mutex = PTHREAD_MUTEX_INITIALIZER;
39
40void 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
64void sqlengine_thd_end(struct thdpool *pool, struct sqlthdstate *thd)
65{

Callers 2

thdpool_sqlengine_startFunction · 0.85
exec_triggerFunction · 0.85

Calls 7

backend_thread_eventFunction · 0.85
sql_mem_initFunction · 0.85
thrman_registerFunction · 0.85
thrman_get_reqloggerFunction · 0.85
start_sql_threadFunction · 0.85
rcache_initFunction · 0.85
bdb_attr_getFunction · 0.85

Tested by

no test coverage detected