From cf5a6c581514f9417119d727b890f7bdfb183ab8 Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 20 Nov 2012 15:29:03 +0000 Subject: [PATCH] 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 --- modules/server/mysqldb.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/server/mysqldb.cpp b/modules/server/mysqldb.cpp index 1024a305..bf9f8a76 100644 --- a/modules/server/mysqldb.cpp +++ b/modules/server/mysqldb.cpp @@ -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",