summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/concurrent/APRThread.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-17 21:03:03 +0000
committerAlan Conway <aconway@apache.org>2006-10-17 21:03:03 +0000
commit9da1df0a07bb9543078fd5384e47dc651e4ceaf0 (patch)
tree5201030359c14d7ad63b789b050ddc467683dcbb /cpp/src/qpid/concurrent/APRThread.cpp
parent3706a84dc89c1e667472a9854f4cd8375fe25345 (diff)
downloadqpid-python-9da1df0a07bb9543078fd5384e47dc651e4ceaf0.tar.gz
Fix core dump if address in use.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@465054 13f79535-47bb-0310-9956-ffa450edef68
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(){