MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Decrease

Method Decrease

oneflow/core/common/blocking_counter.cpp:31–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31int64_t BlockingCounter::Decrease() {
32 std::unique_lock<std::mutex> lck(mtx_);
33 cnt_val_ -= 1;
34 if (cnt_val_ == 0) { cond_.notify_all(); }
35 return cnt_val_;
36}
37
38Maybe<void> BlockingCounter::WaitUntilCntEqualZero(size_t timeout_seconds) {
39 return Singleton<ForeignLockHelper>::Get()->WithScopedRelease([&, this]() -> Maybe<void> {

Callers 15

FOR_RANGEMethod · 0.45
FOR_RANGEFunction · 0.45
FOR_RANGEMethod · 0.45
FOR_RANGEMethod · 0.45
WaitDoneMethod · 0.45
AccessToOtherRanksFunction · 0.45
CompileMethod · 0.45
DecreaseCounterMethod · 0.45
PutBlocksMethod · 0.45
ParallelForMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected