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

Function done_sql_thread

db/sqlglue.c:796–819  ·  view source on GitHub ↗

sql thread pool relies on this being safe to call even if we didn't * register with start_sql_thread */

Source from the content-addressed store, hash-verified

794/* sql thread pool relies on this being safe to call even if we didn't
795 * register with start_sql_thread */
796void done_sql_thread(void)
797{
798 struct sql_thread *thd = pthread_getspecific(query_info_key);
799 if (thd) {
800 Pthread_mutex_lock(&gbl_sql_lock);
801 listc_rfl(&thedb->sql_threads, thd);
802 Pthread_mutex_unlock(&gbl_sql_lock);
803 Pthread_mutex_destroy(&thd->lk);
804 Pthread_setspecific(query_info_key, NULL);
805 if (thd->buf) {
806 free(thd->buf);
807 thd->buf = NULL;
808 }
809 if (thd->query_hash) {
810 hash_for(thd->query_hash, free_queryhash, NULL);
811 hash_clear(thd->query_hash);
812 hash_free(thd->query_hash);
813 thd->query_hash = 0;
814 }
815 destroy_sqlite_master(thd->rootpages, thd->rootpage_nentries);
816 free(thd);
817 }
818 bdb_temp_table_maybe_reset_priority_thread(thedb->bdb_env, 1);
819}
820
821static int ondisk_to_sqlite_tz(struct dbtable *db, struct schema *s, void *inp,
822 int rrn, unsigned long long genid, void *outp,

Callers 6

handle_remtran_requestFunction · 0.85
sqlengine_thd_endFunction · 0.85
sql_syntax_checkFunction · 0.85
resolve_sfuncs_for_dbFunction · 0.85
stat4dumpFunction · 0.85
run_sql_return_llFunction · 0.85

Calls 7

listc_rflFunction · 0.85
freeFunction · 0.85
hash_forFunction · 0.85
hash_clearFunction · 0.85
hash_freeFunction · 0.85
destroy_sqlite_masterFunction · 0.85

Tested by

no test coverage detected