Skip to content

Commit

Permalink
Merge pull request #637 from dsimcha/master
Browse files Browse the repository at this point in the history
Remove incorrect assert from std.parallelism
  • Loading branch information
jmdavis committed Jun 17, 2012
2 parents a1e79c7 + 31276a5 commit 57a9eca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion std/parallelism.d
Original file line number Diff line number Diff line change
Expand Up @@ -4058,13 +4058,18 @@ unittest
pool1.finish();
assert(!tSlow.done);
tSlow.yieldForce();
assert(pool1.status == TaskPool.PoolState.stopNow);
// Can't assert that pool1.status == PoolState.stopNow because status
// doesn't change until after the "done" flag is set and the waiting
// thread is woken up.

auto pool2 = new TaskPool();
auto tSlow2 = task!slowFun();
pool2.put(tSlow2);
pool2.finish(true); // blocking
assert(tSlow2.done);

// This is correct because no thread will terminate unless pool2.status
// has already been set to stopNow.
assert(pool2.status == TaskPool.PoolState.stopNow);
}

Expand Down

0 comments on commit 57a9eca

Please sign in to comment.