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

Method ThreadLocal

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

* Constructor that has to be called from a thread-neutral place. */

Source from the content-addressed store, hash-verified

476 * Constructor that has to be called from a thread-neutral place.
477 */
478 ThreadLocal() : m_key(0) {
479#ifdef __APPLE__
480 ThreadLocalCreateKey(&m_key, nullptr);
481 ThreadLocalCreateKey(&m_cleanup_key,
482 ThreadLocalOnThreadExit<darwin_pthread_handler>);
483#else
484 ThreadLocalCreateKey(&m_key, ThreadLocalOnThreadExit<T>);
485#endif
486 }
487
488 T *get() const {
489 T *obj = (T*)pthread_getspecific(m_key);

Callers

nothing calls this directly

Calls 1

ThreadLocalCreateKeyFunction · 0.85

Tested by

no test coverage detected