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

Method RemoveRef

mars/comm/windows/thread/thread.h:185–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184 void AddRef() { count++;}
185 void RemoveRef(ScopedSpinLock& _lock) {
186 ASSERT(0 < count);
187 ASSERT(_lock.islocked());
188
189 bool willdel = false;
190 count--;
191
192 if (0 == count) willdel = true;
193
194 _lock.unlock();
195
196 if (willdel) delete this;
197 }
198
199 private:
200 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