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

Function _init_init_lock

deps/jemalloc/src/jemalloc.c:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

malloc_init_hardFunction · 0.70

Calls 1

malloc_mutex_initFunction · 0.70

Tested by

no test coverage detected