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

Method Unpark

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

Source from the content-addressed store, hash-verified

228 }
229
230 void Unpark(Waiter* w) {
231 for (Waiter* next; w; w = next) {
232 uint64_t wnext = w->next.load(std::memory_order_relaxed) & kStackMask;
233 next = wnext == kStackMask ? nullptr : &waiters_[internal::convert_index<size_t>(wnext)];
234 unsigned state;
235 {
236 EIGEN_MUTEX_LOCK lock(w->mu);
237 state = w->state;
238 w->state = Waiter::kSignaled;
239 }
240 // Avoid notifying if it wasn't waiting.
241 if (state == Waiter::kWaiting) w->cv.notify_one();
242 }
243 }
244
245 EventCount(const EventCount&) = delete;
246 void operator=(const EventCount&) = delete;

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected