summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/concurrent/APRThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/concurrent/APRThread.cpp')
-rw-r--r--cpp/src/qpid/concurrent/APRThread.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/qpid/concurrent/APRThread.cpp b/cpp/src/qpid/concurrent/APRThread.cpp
index f1bfa6c7da..d4d073cac6 100644
--- a/cpp/src/qpid/concurrent/APRThread.cpp
+++ b/cpp/src/qpid/concurrent/APRThread.cpp
@@ -27,7 +27,7 @@ void* APR_THREAD_FUNC ExecRunnable(apr_thread_t* thread, void *data){
return NULL;
}
-APRThread::APRThread(apr_pool_t* _pool, Runnable* _runnable) : runnable(_runnable), pool(_pool) {}
+APRThread::APRThread(apr_pool_t* _pool, Runnable* _runnable) : runnable(_runnable), pool(_pool), runner(0) {}
APRThread::~APRThread(){
}
@@ -38,11 +38,11 @@ void APRThread::start(){
void APRThread::join(){
apr_status_t status;
- CHECK_APR_SUCCESS(apr_thread_join(&status, runner));
+ if (runner) CHECK_APR_SUCCESS(apr_thread_join(&status, runner));
}
void APRThread::interrupt(){
- CHECK_APR_SUCCESS(apr_thread_exit(runner, APR_SUCCESS));
+ if (runner) CHECK_APR_SUCCESS(apr_thread_exit(runner, APR_SUCCESS));
}
unsigned int qpid::concurrent::APRThread::currentThread(){