Commit dae75ab8 authored by Davis King's avatar Davis King

Fixed the deadlock I just introduced a few minutes ago.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402692
parent 4adb16cc
...@@ -58,7 +58,7 @@ namespace dlib ...@@ -58,7 +58,7 @@ namespace dlib
) const ) const
{ {
auto_mutex M(m); auto_mutex M(m);
if (num_threads_in_pool() != 0) if (tasks.size() != 0)
{ {
const unsigned long idx = task_id_to_index(task_id); const unsigned long idx = task_id_to_index(task_id);
while (tasks[idx].task_id == task_id) while (tasks[idx].task_id == task_id)
...@@ -110,7 +110,7 @@ namespace dlib ...@@ -110,7 +110,7 @@ namespace dlib
// if there aren't any threads in the pool then we consider all threads // if there aren't any threads in the pool then we consider all threads
// to be worker threads // to be worker threads
if (num_threads_in_pool() == 0) if (tasks.size() == 0)
return true; return true;
else else
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment