MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / tsd_in_nominal_list

Function tsd_in_nominal_list

deps/jemalloc/src/tsd.c:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66static atomic_u32_t tsd_global_slow_count = ATOMIC_INIT(0);
67
68static bool
69tsd_in_nominal_list(tsd_t *tsd) {
70 tsd_t *tsd_list;
71 bool found = false;
72 /*
73 * We don't know that tsd is nominal; it might not be safe to get data
74 * out of it here.
75 */
76 malloc_mutex_lock(TSDN_NULL, &tsd_nominal_tsds_lock);
77 ql_foreach(tsd_list, &tsd_nominal_tsds, TSD_MANGLE(tcache).tsd_link) {
78 if (tsd == tsd_list) {
79 found = true;
80 break;
81 }
82 }
83 malloc_mutex_unlock(TSDN_NULL, &tsd_nominal_tsds_lock);
84 return found;
85}
86
87static void
88tsd_add_nominal(tsd_t *tsd) {

Callers 4

tsd_add_nominalFunction · 0.85
tsd_remove_nominalFunction · 0.85
tsd_state_setFunction · 0.85

Calls 3

malloc_mutex_lockFunction · 0.50
ql_foreachFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected