Avoid bogus assertion failure.
Since the task queue entries never got cleaned up, the assertion got triggered once already used queue slots were starting to get reused.
This commit is contained in:
parent
e81589fa3e
commit
0895cd1960
|
@ -337,8 +337,11 @@ nothrow @safe:
|
||||||
|
|
||||||
bool consume(ref TaskFuncInfo tfi)
|
bool consume(ref TaskFuncInfo tfi)
|
||||||
{
|
{
|
||||||
|
import std.algorithm.mutation : swap;
|
||||||
|
|
||||||
if (m_queue.empty) return false;
|
if (m_queue.empty) return false;
|
||||||
m_queue.read(() @trusted { return (&tfi)[0 .. 1]; } ());
|
swap(tfi, m_queue.front);
|
||||||
|
m_queue.popFront();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue