diff options
| author | 2019-05-15 16:22:24 +0100 | |
|---|---|---|
| committer | 2019-05-15 21:06:09 +0100 | |
| commit | 03d3563ef95efc6ab8076d66ebda48545c6089c4 (patch) | |
| tree | 0160e0a3b333a000c7c880d9373b46cfa3968e79 /src/modules/extra/m_ldap.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| download | inspircd++-03d3563ef95efc6ab8076d66ebda48545c6089c4.tar.gz inspircd++-03d3563ef95efc6ab8076d66ebda48545c6089c4.tar.bz2 inspircd++-03d3563ef95efc6ab8076d66ebda48545c6089c4.zip | |
Replace socketengine_{pthread,win32} with C++11 threads.
Diffstat (limited to 'src/modules/extra/m_ldap.cpp')
| -rw-r--r-- | src/modules/extra/m_ldap.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index d6cad357b..fd5761cf6 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -251,7 +251,7 @@ class LDAPService : public LDAPProvider, public SocketThread public: typedef std::vector<LDAPRequest*> query_queue; query_queue queries, results; - Mutex process_mutex; /* held when processing requests not in either queue */ + std::mutex process_mutex; /* held when processing requests not in either queue */ LDAPService(Module* c, ConfigTag* tag) : LDAPProvider(c, "LDAP/" + tag->getString("id")) @@ -431,7 +431,7 @@ class LDAPService : public LDAPProvider, public SocketThread void SendRequests() { - process_mutex.Lock(); + process_mutex.lock(); query_queue q; this->LockQueue(); @@ -440,7 +440,7 @@ class LDAPService : public LDAPProvider, public SocketThread if (q.empty()) { - process_mutex.Unlock(); + process_mutex.unlock(); return; } @@ -472,13 +472,13 @@ class LDAPService : public LDAPProvider, public SocketThread this->NotifyParent(); - process_mutex.Unlock(); + process_mutex.unlock(); } public: - void Run() override + void OnStart() override { - while (!this->GetExitFlag()) + while (!this->IsStopping()) { this->LockQueue(); if (this->queries.empty()) @@ -545,7 +545,7 @@ class ModuleLDAP : public Module conns[id] = conn; ServerInstance->Modules.AddService(*conn); - ServerInstance->Threads.Start(conn); + conn->Start(); } else { @@ -558,7 +558,7 @@ class ModuleLDAP : public Module { LDAPService* conn = i->second; ServerInstance->Modules.DelService(*conn); - conn->join(); + conn->Stop(); conn->OnNotify(); delete conn; } @@ -572,7 +572,7 @@ class ModuleLDAP : public Module { LDAPService* s = it->second; - s->process_mutex.Lock(); + s->process_mutex.lock(); s->LockQueue(); for (unsigned int i = s->queries.size(); i > 0; --i) @@ -600,7 +600,7 @@ class ModuleLDAP : public Module } s->UnlockQueue(); - s->process_mutex.Unlock(); + s->process_mutex.unlock(); } } @@ -609,7 +609,7 @@ class ModuleLDAP : public Module for (ServiceMap::iterator i = LDAPServices.begin(); i != LDAPServices.end(); ++i) { LDAPService* conn = i->second; - conn->join(); + conn->Stop(); conn->OnNotify(); delete conn; } |
