| 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&); |
no test coverage detected