diff options
author | Adam <Adam@anope.org> | 2011-02-17 14:31:21 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-17 14:31:21 -0500 |
commit | 536ea2189ae1ff8bf05583ed03fac86797616ac9 (patch) | |
tree | 30b5056f53dea0d01be10f24360a443833e6565a /src | |
parent | 18bd33f9a477f7ce00d6f3c00acc0b0b68f5028d (diff) |
Split db_mysql_live into two modules so other modules can make use of the asynchronous command interface
Diffstat (limited to 'src')
-rw-r--r-- | src/threadengine.cpp | 6 | ||||
-rw-r--r-- | src/threadengines/threadengine_pthread.cpp | 7 | ||||
-rw-r--r-- | src/threadengines/threadengine_win32.cpp | 7 |
3 files changed, 17 insertions, 3 deletions
diff --git a/src/threadengine.cpp b/src/threadengine.cpp index 0ac049c38..c2aa3da20 100644 --- a/src/threadengine.cpp +++ b/src/threadengine.cpp @@ -20,7 +20,7 @@ void ThreadEngine::Process() /** Threads constructor */ -Thread::Thread() : Exit(false) +Thread::Thread() : exit(false) { threadEngine.threads.push_back(this); } @@ -41,7 +41,7 @@ Thread::~Thread() */ void Thread::SetExitState() { - Exit = true; + exit = true; } /** Returns the exit state of the thread @@ -49,7 +49,7 @@ void Thread::SetExitState() */ bool Thread::GetExitState() const { - return Exit; + return exit; } /** Called to run the thread, should be overloaded diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp index acdccfeb5..e8242bb82 100644 --- a/src/threadengines/threadengine_pthread.cpp +++ b/src/threadengines/threadengine_pthread.cpp @@ -39,6 +39,13 @@ void Thread::Join() pthread_join(Handle, NULL); } +/** Exit the thread. Note that the thread still must be joined to free resources! + */ +void Thread::Exit() +{ + pthread_exit(0); +} + /** Start a new thread * @param thread A pointer to a newley allocated thread */ diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp index e6ad725bf..218f711c4 100644 --- a/src/threadengines/threadengine_win32.cpp +++ b/src/threadengines/threadengine_win32.cpp @@ -31,6 +31,13 @@ void Thread::Join() WaitForSingleObject(Handle, INFINITE); } +/** Exit the thread. Note that the thread still must be joined to free resources! + */ +void Thread::Exit() +{ + ExitThread(0); +} + /** Start a new thread * @param thread A pointer to a newley allocated thread */ |