MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / Prewait

Method Prewait

include/Eigen/Eigen/src/ThreadPool/EventCount.h:68–78  ·  view source on GitHub ↗

Prewait prepares for waiting. After calling Prewait, the thread must re-check the wait predicate and then call either CancelWait or CommitWait.

Source from the content-addressed store, hash-verified

66 // After calling Prewait, the thread must re-check the wait predicate
67 // and then call either CancelWait or CommitWait.
68 void Prewait() {
69 uint64_t state = state_.load(std::memory_order_relaxed);
70 for (;;) {
71 CheckState(state);
72 uint64_t newstate = state + kWaiterInc;
73 CheckState(newstate);
74 if (state_.compare_exchange_weak(state, newstate,
75 std::memory_order_seq_cst))
76 return;
77 }
78 }
79
80 // CommitWait commits waiting after Prewait.
81 void CommitWait(Waiter* w) {

Callers 1

WaitForWorkMethod · 0.80

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected