MCPcopy Create free account
hub / github.com/Tencent/mars / RemoveRef

Method RemoveRef

mars/comm/unix/thread/thread.h:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88 void AddRef() { count++;}
89 void RemoveRef(ScopedSpinLock& _lock) {
90 ASSERT(0 < count);
91 ASSERT(_lock.islocked());
92
93 bool willdel = false;
94 count--;
95
96 if (0 == count) willdel = true;
97
98 _lock.unlock();
99
100 if (willdel) delete this;
101 }
102
103 private:
104 RunnableReference(const RunnableReference&);

Callers 5

~ThreadMethod · 0.45
startMethod · 0.45
start_afterMethod · 0.45
start_periodicMethod · 0.45
cleanupMethod · 0.45

Calls 2

islockedMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected