Lines Matching refs:mutex
67 JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
72 malloc_mutex_init(malloc_mutex_t *mutex, const char *name, witness_rank_t rank) in malloc_mutex_init() argument
77 InitializeSRWLock(&mutex->lock); in malloc_mutex_init()
79 if (!InitializeCriticalSectionAndSpinCount(&mutex->lock, in malloc_mutex_init()
84 mutex->lock = OS_UNFAIR_LOCK_INIT; in malloc_mutex_init()
86 mutex->lock = 0; in malloc_mutex_init()
89 mutex->postponed_next = postponed_mutexes; in malloc_mutex_init()
90 postponed_mutexes = mutex; in malloc_mutex_init()
92 if (_pthread_mutex_init_calloc_cb(&mutex->lock, in malloc_mutex_init()
102 if (pthread_mutex_init(&mutex->lock, &attr) != 0) { in malloc_mutex_init()
109 witness_init(&mutex->witness, name, rank, NULL); in malloc_mutex_init()
114 malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_prefork() argument
117 malloc_mutex_lock(tsdn, mutex); in malloc_mutex_prefork()
121 malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_postfork_parent() argument
124 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_parent()
128 malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_postfork_child() argument
132 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_child()
134 if (malloc_mutex_init(mutex, mutex->witness.name, in malloc_mutex_postfork_child()
135 mutex->witness.rank)) { in malloc_mutex_postfork_child()