| 190 | } |
| 191 | |
| 192 | struct 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 | |
| 211 | struct thdpool *get_sql_pool(struct sqlclntstate *clnt) |
| 212 | { |
no test coverage detected