MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _init_init_lock

Function _init_init_lock

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:134–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133JEMALLOC_ATTR(constructor)
134static void WINAPI
135_init_init_lock(void) {
136 /*
137 * If another constructor in the same binary is using mallctl to e.g.
138 * set up extent hooks, it may end up running before this one, and
139 * malloc_init_hard will crash trying to lock the uninitialized lock. So
140 * we force an initialization of the lock in malloc_init_hard as well.
141 * We don't try to care about atomicity of the accessed to the
142 * init_lock_initialized boolean, since it really only matters early in
143 * the process creation, before any separate thread normally starts
144 * doing anything.
145 */
146 if (!init_lock_initialized) {
147 malloc_mutex_init(&init_lock, "init", WITNESS_RANK_INIT,
148 malloc_mutex_rank_exclusive);
149 }
150 init_lock_initialized = true;
151}
152
153#ifdef _MSC_VER
154# pragma section(".CRT$XCU", read)

Callers 1

malloc_init_hardFunction · 0.85

Calls 1

malloc_mutex_initFunction · 0.85

Tested by

no test coverage detected