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:
Machiavelli
2011-01-15 20:59:37 +01:00
parent 38816cb1df
commit 29a8b5407a
2 changed files with 1 additions and 17 deletions

View File

@@ -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.
}

View File

@@ -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: