No thread - and especially initialization - must wait forever at semaphore.

git-svn-id: http://yate.null.ro/svn/yate/trunk@5327 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2012-11-20 15:29:03 +00:00
parent 2acf2f37fa
commit cf5a6c5815
1 changed files with 2 additions and 4 deletions

View File

@ -543,15 +543,13 @@ bool MyAcct::initDb()
Debug(&module,DebugNote,"Initiating pool of %d connections for '%s'",
m_poolSize,c_str());
m_queueSem.lock();
s_libMutex.lock();
if (0 == s_libCounter++) {
DDebug(&module,DebugAll,"Initializing the MySQL library");
mysql_library_init(0,0,0);
}
s_libMutex.unlock();
int initCons = initConns();
if (!initCons) {
Debug(&module,DebugWarn,"Could not initiate any connections for account '%s', trying again in %d seconds",
@ -744,7 +742,7 @@ void InitThread::run()
if (acc->shouldRetryInit() && acc->retryWhen() <= Time::msecNow()) {
int count = acc->initConns();
if (count < acc->poolSize())
Debug(&module,(count ? DebugMild : DebugWarn),"Account '%s' has %d initialized connections out of "
Debug(&module,(count ? DebugMild : DebugWarn),"Account '%s' has %d initialized connections out of"
" a pool of %d",acc->c_str(),count,acc->poolSize());
else
Debug(&module,DebugInfo,"All connections for account '%s' have been initialized, pool size is %d",