hi
  this function ConnectionPool_getConnection is designed badly。 
  between code LOCK(P->mutex)  and END_LOCK,  Connection_ping and  Connection_new may block long time (reconnect/connect to sql server),so other threads will wait long time.
  should't block when locked!!!!

see below code for detail:
Connection_T ConnectionPool_getConnection(T P) {
Connection_T con = NULL;
assert(P);
LOCK(P->mutex) 
        {
                int size = Vector_size(P->pool);
                for (int i = 0; i < size; i++) {
                        con = Vector_get(P->pool, i);
                        if (Connection_isAvailable(con) && Connection_ping(con)) {
                                Connection_setAvailable(con, false);
                                goto done;
                        } 
                }
                con = NULL;
                if (size < P->maxConnections) {
                        con = Connection_new(P, &P->error);
                        if (con) {
                                Connection_setAvailable(con, false);
                                Vector_push(P->pool, con);
                        } else {
                                DEBUG("Failed to create connection -- %s\n", P->error);
                                FREE(P->error);
                        }
                }
        }
done: 
        END_LOCK;
return con;
}