mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 11:52:32 +01:00
Core/DBLayer: Use default parameters for DatabaseWorker::activate. Fixes a possible desyncrhonisation issue when DatabaseWorkerPool calls wait() on the workers.
This commit is contained in:
@@ -50,18 +50,3 @@ int DatabaseWorker::svc()
|
||||
m_conn->Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DatabaseWorker::activate()
|
||||
{
|
||||
/* THR_DETACHED:
|
||||
Create an asynchronous thread. The exit status of the thread would not be available to any other threads.
|
||||
The thread resources are reclaimed by the operating system whenever the thread is terminated. */
|
||||
|
||||
/* THR_NEW_LWP:
|
||||
Create an explicit kernel-level thread (as opposed to a user-level thread). */
|
||||
|
||||
ACE_Task_Base::activate(THR_NEW_LWP | THR_DETACHED, 1);
|
||||
return 0; //^ - Spawn one thread to handle this task.
|
||||
// However more of these tasks may be activated
|
||||
// See DatabaseWorkerPool ctor.
|
||||
}
|
||||
@@ -23,14 +23,13 @@
|
||||
|
||||
class MySQLConnection;
|
||||
|
||||
class DatabaseWorker : public ACE_Task_Base
|
||||
class DatabaseWorker : protected ACE_Task_Base
|
||||
{
|
||||
public:
|
||||
DatabaseWorker(ACE_Activation_Queue* new_queue, MySQLConnection* con);
|
||||
|
||||
///- Inherited from ACE_Task_Base
|
||||
int svc();
|
||||
int activate();
|
||||
int wait() { return ACE_Task_Base::wait(); }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user