mirror of https://github.com/davisking/dlib.git
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:
parent
4adb16ccde
commit
dae75ab855
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue