MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / consumer_commit

Method consumer_commit

src/core/impl/utils/thread.cpp:230–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void SCQueueSynchronizer::consumer_commit(size_t nr) {
231 auto done = m_finished_task.fetch_add(nr, std::memory_order_relaxed) + nr;
232 // pair with the thread fence in producer_wait()
233 std::atomic_thread_fence(std::memory_order_seq_cst);
234 if (done >= m_waiter_target.load(std::memory_order_relaxed)) {
235 MGB_LOCK_GUARD(m_mtx_finished);
236 m_cv_finished.notify_all();
237 }
238}
239
240/* =============== SyncableCounter =============== */
241

Callers 4

TESTFunction · 0.80
worker_thread_implMethod · 0.80

Calls 1

loadMethod · 0.45

Tested by 2

TESTFunction · 0.64