Join an existing circle. L < g_linked_ptr_mutex
| 9061 | // Join an existing circle. |
| 9062 | // L < g_linked_ptr_mutex |
| 9063 | void join(linked_ptr_internal const* ptr) { |
| 9064 | MutexLock lock(&g_linked_ptr_mutex); |
| 9065 | |
| 9066 | linked_ptr_internal const* p = ptr; |
| 9067 | while (p->next_ != ptr) p = p->next_; |
| 9068 | p->next_ = this; |
| 9069 | next_ = ptr; |
| 9070 | } |
| 9071 | |
| 9072 | // Leave whatever circle we're part of. Returns true if we were the |
| 9073 | // last member of the circle. Once this is done, you can join() another. |
no outgoing calls
no test coverage detected