Remove a broken ASSERT.

It's now totally valid to have:
permits=3
take(1)
take(2)
take(72)

and the take(72) will only be granted once the first two finish.
This commit is contained in:
Alex Miller 2019-03-07 18:31:18 -08:00
parent 668eaeb8ae
commit 4891d31cc0

View File

@ -1218,7 +1218,6 @@ struct FlowLock : NonCopyable, public ReferenceCounted<FlowLock> {
explicit FlowLock(int64_t permits) : permits(permits), active(0) {}
Future<Void> take(int taskID = TaskDefaultYield, int64_t amount = 1) {
ASSERT(amount <= permits || active == 0);
if (active + amount <= permits || active == 0) {
active += amount;
return safeYieldActor(this, taskID, amount);