MCPcopy Create free account
hub / github.com/apple/foundationdb / destroyHolder

Method destroyHolder

flow/include/flow/ThreadHelper.actor.h:159–174  ·  view source on GitHub ↗

Destroy the given MultiCallbackHolder, freeing it if it is not firstHolder.

Source from the content-addressed store, hash-verified

157
158 // Destroy the given MultiCallbackHolder, freeing it if it is not firstHolder.
159 void destroyHolder(MultiCallbackHolder* h) {
160 UNSTOPPABLE_ASSERT(h != nullptr);
161
162 // If h is the firstHolder just clear its holder pointer to indicate unusedness
163 if (h == &firstHolder) {
164 h->multiCallback = nullptr;
165 } else {
166 // Otherwise unlink h from the doubly linked list and free it
167 // h->previous is definitely valid
168 h->previous->next = h->next;
169 if (h->next) {
170 h->next->previous = h->previous;
171 }
172 delete h;
173 }
174 }
175};
176
177class ThreadMultiCallback final : public ThreadCallback, public FastAllocated<ThreadMultiCallback> {

Callers 3

clearCallbackMethod · 0.80
fireMethod · 0.80
errorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected