git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10405
e03df62e-2008-0410-955e-
edbf42e46eb7
- Parent->QueueMutex->Enable(true);
+ Parent->QueueMutex->Lock();
- Parent->QueueMutex->Enable(false);
+ Parent->QueueMutex->Unlock();
if (!mysql_real_query(&connection, req.query.q.data(), req.query.q.length()))
{
if (!mysql_real_query(&connection, req.query.q.data(), req.query.q.length()))
{
/* Put this new result onto the results queue.
* XXX: Remember to mutex the queue!
*/
/* Put this new result onto the results queue.
* XXX: Remember to mutex the queue!
*/
- Parent->ResultsMutex->Enable(true);
+ Parent->ResultsMutex->Lock();
- Parent->ResultsMutex->Enable(false);
+ Parent->ResultsMutex->Unlock();
r->dbid = this->GetID();
r->query = req.query.q;
r->dbid = this->GetID();
r->query = req.query.q;
- Parent->ResultsMutex->Enable(true);
+ Parent->ResultsMutex->Lock();
- Parent->ResultsMutex->Enable(false);
+ Parent->ResultsMutex->Unlock();
}
/* Now signal the main thread that we've got a result to process.
}
/* Now signal the main thread that we've got a result to process.
if (!i->second->Connect())
{
/* XXX: MUTEX */
if (!i->second->Connect())
{
/* XXX: MUTEX */
- Parent->LoggingMutex->Enable(true);
+ Parent->LoggingMutex->Lock();
ServerInstance->Logs->Log("m_mysql",DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError());
i->second->SetEnable(false);
ServerInstance->Logs->Log("m_mysql",DEFAULT,"SQL: Failed to connect database "+i->second->GetHost()+": Error: "+i->second->GetError());
i->second->SetEnable(false);
- Parent->LoggingMutex->Enable(false);
+ Parent->LoggingMutex->Unlock();
if (iter != Connections.end())
{
/* Lock the mutex, send back the data */
if (iter != Connections.end())
{
/* Lock the mutex, send back the data */
- Parent->ResultsMutex->Enable(true);
+ Parent->ResultsMutex->Lock();
ResultQueue::iterator n = iter->second->rq.begin();
(*n)->Send();
delete (*n);
iter->second->rq.pop_front();
ResultQueue::iterator n = iter->second->rq.begin();
(*n)->Send();
delete (*n);
iter->second->rq.pop_front();
- Parent->ResultsMutex->Enable(false);
+ Parent->ResultsMutex->Unlock();
return true;
}
/* No error, but unknown id */
return true;
}
/* No error, but unknown id */
SQLrequest* req = (SQLrequest*)request;
/* XXX: Lock */
SQLrequest* req = (SQLrequest*)request;
/* XXX: Lock */
- QueueMutex->Enable(true);
req->error.Id(SQL_BAD_DBID);
}
req->error.Id(SQL_BAD_DBID);
}
- QueueMutex->Enable(false);
/* XXX: Unlock */
return returnval;
/* XXX: Unlock */
return returnval;
if (Parent->rehashing)
{
/* XXX: Lock */
if (Parent->rehashing)
{
/* XXX: Lock */
- Parent->QueueMutex->Enable(true);
+ Parent->QueueMutex->Lock();
Parent->rehashing = false;
LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
Parent->rehashing = false;
LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent);
- Parent->QueueMutex->Enable(false);
+ Parent->QueueMutex->Unlock();
/* XXX: Unlock */
}
SQLConnection* conn = NULL;
/* XXX: Lock here for safety */
/* XXX: Unlock */
}
SQLConnection* conn = NULL;
/* XXX: Lock here for safety */
- Parent->QueueMutex->Enable(true);
+ Parent->QueueMutex->Lock();
for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++)
{
if (i->second->queue.totalsize())
for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++)
{
if (i->second->queue.totalsize())
- Parent->QueueMutex->Enable(false);
+ Parent->QueueMutex->Unlock();
/* XXX: Unlock */
/* Theres an item! */
/* XXX: Unlock */
/* Theres an item! */
conn->DoLeadingQuery();
/* XXX: Lock */
conn->DoLeadingQuery();
/* XXX: Lock */
- Parent->QueueMutex->Enable(true);
+ Parent->QueueMutex->Lock();
- Parent->QueueMutex->Enable(false);
+ Parent->QueueMutex->Unlock();