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

Function start_sql_thread

db/sqlglue.c:766–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766struct sql_thread *start_sql_thread(void)
767{
768 struct sql_thread *thd = calloc(1, sizeof(struct sql_thread));
769 if (!thd) {
770 logmsg(LOGMSG_ERROR, "%s: calloc failed\n", __func__);
771 return NULL;
772 }
773 listc_init(&thd->query_stats, offsetof(struct query_path_component, lnk));
774 thd->query_hash = hash_init_user(query_path_component_hash,
775 query_path_component_cmp, 0, 0);
776 Pthread_mutex_init(&thd->lk, NULL);
777 Pthread_setspecific(query_info_key, thd);
778 Pthread_mutex_lock(&gbl_sql_lock);
779 listc_abl(&thedb->sql_threads, thd);
780 Pthread_mutex_unlock(&gbl_sql_lock);
781
782 thd->crtshard = 0;
783
784 return thd;
785}
786
787static int free_queryhash(void *obj, void *arg)
788{

Callers 7

handle_remtran_requestFunction · 0.85
sqlengine_thd_startFunction · 0.85
sql_syntax_checkFunction · 0.85
resolve_sfuncs_for_dbFunction · 0.85
stat4dumpFunction · 0.85
run_sql_return_llFunction · 0.85
logical_cron_kickoffFunction · 0.85

Calls 5

callocFunction · 0.85
listc_initFunction · 0.85
hash_init_userFunction · 0.85
listc_ablFunction · 0.85
logmsgFunction · 0.50

Tested by

no test coverage detected