[8463] Fixed race conditions in LockedQueue.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
XTZGZoReX 2009-08-30 23:23:46 +02:00 committed by ApoC
parent 7f444189c6
commit 66ffd80ed2
6 changed files with 42 additions and 86 deletions

View file

@ -26,7 +26,6 @@ SqlDelayThread::SqlDelayThread(Database* db) : m_dbEngine(db), m_running(true)
void SqlDelayThread::run()
{
SqlOperation* s;
#ifndef DO_POSTGRESQL
mysql_thread_init();
#endif
@ -36,9 +35,9 @@ void SqlDelayThread::run()
// if the running state gets turned off while sleeping
// empty the queue before exiting
ACE_Based::Thread::Sleep(10);
while (!m_sqlQueue.empty())
SqlOperation* s;
while (m_sqlQueue.next(s))
{
s = m_sqlQueue.next();
s->Execute(m_dbEngine);
delete s;
}