Lines Matching refs:mutex
42 JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
47 malloc_mutex_lock_slow(malloc_mutex_t *mutex) { in malloc_mutex_lock_slow() argument
48 mutex_prof_data_t *data = &mutex->prof_data; in malloc_mutex_lock_slow()
58 if (!malloc_mutex_trylock_final(mutex)) { in malloc_mutex_lock_slow()
66 malloc_mutex_lock_final(mutex); in malloc_mutex_lock_slow()
77 if (!malloc_mutex_trylock_final(mutex)) { in malloc_mutex_lock_slow()
84 malloc_mutex_lock_final(mutex); in malloc_mutex_lock_slow()
112 malloc_mutex_prof_data_reset(tsdn_t *tsdn, malloc_mutex_t *mutex) { in malloc_mutex_prof_data_reset() argument
113 malloc_mutex_assert_owner(tsdn, mutex); in malloc_mutex_prof_data_reset()
114 mutex_prof_data_init(&mutex->prof_data); in malloc_mutex_prof_data_reset()
134 malloc_mutex_init(malloc_mutex_t *mutex, const char *name, in malloc_mutex_init() argument
136 mutex_prof_data_init(&mutex->prof_data); in malloc_mutex_init()
139 InitializeSRWLock(&mutex->lock); in malloc_mutex_init()
141 if (!InitializeCriticalSectionAndSpinCount(&mutex->lock, in malloc_mutex_init()
147 mutex->lock = OS_UNFAIR_LOCK_INIT; in malloc_mutex_init()
149 mutex->lock = 0; in malloc_mutex_init()
152 mutex->postponed_next = postponed_mutexes; in malloc_mutex_init()
153 postponed_mutexes = mutex; in malloc_mutex_init()
155 if (_pthread_mutex_init_calloc_cb(&mutex->lock, in malloc_mutex_init()
167 if (pthread_mutex_init(&mutex->lock, &attr) != 0) { in malloc_mutex_init()
174 mutex->lock_order = lock_order; in malloc_mutex_init()
176 witness_init(&mutex->witness, name, rank, in malloc_mutex_init()
177 mutex_addr_comp, mutex); in malloc_mutex_init()
179 witness_init(&mutex->witness, name, rank, NULL, NULL); in malloc_mutex_init()
186 malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex) { in malloc_mutex_prefork() argument
187 malloc_mutex_lock(tsdn, mutex); in malloc_mutex_prefork()
191 malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex) { in malloc_mutex_postfork_parent() argument
192 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_parent()
196 malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) { in malloc_mutex_postfork_child() argument
198 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_child()
200 if (malloc_mutex_init(mutex, mutex->witness.name, in malloc_mutex_postfork_child()
201 mutex->witness.rank, mutex->lock_order)) { in malloc_mutex_postfork_child()