Fixed the deadlock I just introduced a few minutes ago.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402692
This commit is contained in:
Davis King 2008-12-01 22:19:52 +00:00
parent 4adb16ccde
commit dae75ab855

View File

@ -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;