MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DecrementCount

Method DecrementCount

tensorflow/lite/experimental/ruy/blocking_counter.cc:30–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30bool BlockingCounter::DecrementCount() {
31 int old_count_value = count_.fetch_sub(1, std::memory_order_acq_rel);
32 RUY_DCHECK_GT(old_count_value, 0);
33 int count_value = old_count_value - 1;
34 bool hit_zero = (count_value == 0);
35 if (hit_zero) {
36 std::lock_guard<std::mutex> lock(count_mutex_);
37 count_cond_.notify_all();
38 }
39 return hit_zero;
40}
41
42void BlockingCounter::Wait() {
43 const auto& condition = [this]() {

Callers 1

ChangeStateMethod · 0.45

Calls 1

notify_allMethod · 0.80

Tested by

no test coverage detected