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

Method unlock

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

Source from the content-addressed store, hash-verified

29}
30
31void RecursiveSpinlock::unlock() {
32 mgb_assert(
33 m_recur_count &&
34 m_owner.load(std::memory_order_relaxed) == std::this_thread::get_id());
35 if (!(--m_recur_count)) {
36 m_owner.store(sm_none_owner, std::memory_order_release);
37 }
38}
39#else
40#if MGB_HAVE_THREAD
41#error "can not disable thread safety while enabling thread support"

Callers 12

do_recordMethod · 0.45
monitor_eventsMethod · 0.45
wait_tensorMethod · 0.45
wait_workerMethod · 0.45
start_workerMethod · 0.45
on_var_computedMethod · 0.45
do_allocMethod · 0.45
worker_implMethod · 0.45
workMethod · 0.45
scn_do_execute_finishMethod · 0.45
~LockMethod · 0.45
~CpuInfoTmpReplaceMethod · 0.45

Calls 2

loadMethod · 0.45
storeMethod · 0.45

Tested by 1

~CpuInfoTmpReplaceMethod · 0.36