commit ef2f66a99f0a6b1fd71a5bebd0bfbf788461c4b8
parent 587880a6d1467ec6c13af4466454f810263e9386
Author: fundamental <[email protected]>
Date: Sat, 19 Dec 2009 19:38:27 -0500
Nio: prevented false Start/Stop in NulEngine
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/Nio/NulEngine.cpp b/src/Nio/NulEngine.cpp
@@ -85,6 +85,8 @@ NulEngine::~NulEngine()
bool NulEngine::Start()
{
+ if(enabled())
+ return true;
pthread_attr_t attr;
enabled = true;
pthread_attr_init(&attr);
@@ -96,7 +98,9 @@ bool NulEngine::Start()
void NulEngine::Stop()
{
- enabled = false;
+ if(!enabled())
+ return;
+ enabled = false;
pthread_join(pThread, NULL);
}