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

Function get_default_sql_pool

db/sqlpool.c:192–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192struct thdpool *get_default_sql_pool(int bCreate)
193{
194 struct thdpool *pool = sqlengine_pool;
195 if (bCreate && (pool == NULL)) {
196 Pthread_mutex_lock(&sqlengine_pool_mutex);
197 pool = sqlengine_pool; /* NOTE: Double-checked lock. */
198 if (pool == NULL) {
199 pool = create_sql_pool(NULL, 0);
200 if (pool != NULL) {
201 try_add_sql_pool(NULL, 0, pool);
202 sqlengine_pool = pool;
203 }
204 }
205 Pthread_mutex_unlock(&sqlengine_pool_mutex);
206 }
207 if (pool == NULL) abort(); /* NOTE: Default pool MUST exist. */
208 return pool;
209}
210
211struct thdpool *get_sql_pool(struct sqlclntstate *clnt)
212{

Callers 8

handle_buf_main2Function · 0.85
get_sql_poolFunction · 0.85
get_named_sql_poolFunction · 0.85
list_all_sql_pools_funcFunction · 0.85
sqlpool_initFunction · 0.85
process_message.cFile · 0.85

Calls 2

create_sql_poolFunction · 0.85
try_add_sql_poolFunction · 0.85

Tested by

no test coverage detected