From 2d3e12387dd97e3495b5a3fcf1ca7dcad630e7fd Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 2 Feb 2010 23:17:49 +0000 Subject: [PATCH] * Check if the thread is active before sending a signal. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1124 e378c898-3ddf-0310-93e7-cc216c733640 --- src/thread_base.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/thread_base.cc b/src/thread_base.cc index fc4ba7ab..64ff2331 100644 --- a/src/thread_base.cc +++ b/src/thread_base.cc @@ -191,5 +191,8 @@ ThreadBase::call_queued_items() { void ThreadBase::queue_item(thread_base_func newFunc) { m_threadQueue->push_back(newFunc); - pthread_kill(m_thread, SIGUSR1); + + // Make it also restart inactive threads? + if (m_state == STATE_ACTIVE) + pthread_kill(m_thread, SIGUSR1); }