mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-02 19:25:52 +08:00
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:
parent
668eaeb8ae
commit
4891d31cc0
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user