From dae75ab8554243acdf5858ea0ca2c6b0e50a5ebb Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 1 Dec 2008 22:19:52 +0000 Subject: [PATCH] Fixed the deadlock I just introduced a few minutes ago. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402692 --- dlib/threads/thread_pool_extension.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlib/threads/thread_pool_extension.cpp b/dlib/threads/thread_pool_extension.cpp index b69196324..fde1f22d7 100644 --- a/dlib/threads/thread_pool_extension.cpp +++ b/dlib/threads/thread_pool_extension.cpp @@ -58,7 +58,7 @@ namespace dlib ) const { auto_mutex M(m); - if (num_threads_in_pool() != 0) + if (tasks.size() != 0) { const unsigned long idx = task_id_to_index(task_id); while (tasks[idx].task_id == task_id) @@ -110,7 +110,7 @@ namespace dlib // if there aren't any threads in the pool then we consider all threads // to be worker threads - if (num_threads_in_pool() == 0) + if (tasks.size() == 0) return true; else return false;