Merge pull request #88 from vibe-d/fix_infinite_scheduling_issue
Fix possible infinite loop in TaskScheduler.process. merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
This commit is contained in:
commit
d8546b843b
|
@ -962,9 +962,29 @@ private struct TaskFiberQueue {
|
|||
task.m_queue = null;
|
||||
task.m_prev = null;
|
||||
task.m_next = null;
|
||||
length--;
|
||||
}
|
||||
}
|
||||
|
||||
unittest {
|
||||
auto f1 = new TaskFiber;
|
||||
auto f2 = new TaskFiber;
|
||||
|
||||
TaskFiberQueue q;
|
||||
assert(q.empty && q.length == 0);
|
||||
q.insertFront(f1);
|
||||
assert(!q.empty && q.length == 1);
|
||||
q.insertFront(f2);
|
||||
assert(!q.empty && q.length == 2);
|
||||
q.popFront();
|
||||
assert(!q.empty && q.length == 1);
|
||||
q.popFront();
|
||||
assert(q.empty && q.length == 0);
|
||||
q.insertFront(f1);
|
||||
q.remove(f1);
|
||||
assert(q.empty && q.length == 0);
|
||||
}
|
||||
|
||||
private struct FLSInfo {
|
||||
void function(void[], size_t) fct;
|
||||
size_t offset;
|
||||
|
|
Loading…
Reference in a new issue