MCPcopy Create free account
hub / github.com/facebook/react / ThreadLocalSetCleanupHandler

Function ThreadLocalSetCleanupHandler

scripts/perf-counters/src/thread-local.h:446–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446inline void ThreadLocalSetCleanupHandler(pthread_key_t cleanup_key,
447 pthread_key_t key,
448 void (*del)(void*)) {
449 // Prevent from adding the handler for multiple times.
450 darwin_pthread_handler *handler =
451 (darwin_pthread_handler*)pthread_getspecific(cleanup_key);
452 if (handler)
453 return;
454
455 pthread_t self = pthread_self();
456
457 handler = new darwin_pthread_handler();
458 handler->__routine = del;
459 handler->__arg = (void*)key;
460 handler->__next = self->__cleanup_stack;
461 self->__cleanup_stack = handler;
462
463 ThreadLocalSetValue(cleanup_key, handler);
464}
465#endif
466
467/**

Callers 2

getMethod · 0.85
getCheckMethod · 0.85

Calls 1

ThreadLocalSetValueFunction · 0.85

Tested by

no test coverage detected