1*b7eaed25SJason Evans #define JEMALLOC_MUTEX_POOL_C_ 2*b7eaed25SJason Evans 3*b7eaed25SJason Evans #include "jemalloc/internal/jemalloc_preamble.h" 4*b7eaed25SJason Evans #include "jemalloc/internal/jemalloc_internal_includes.h" 5*b7eaed25SJason Evans 6*b7eaed25SJason Evans #include "jemalloc/internal/mutex.h" 7*b7eaed25SJason Evans #include "jemalloc/internal/mutex_pool.h" 8*b7eaed25SJason Evans 9*b7eaed25SJason Evans bool mutex_pool_init(mutex_pool_t * pool,const char * name,witness_rank_t rank)10*b7eaed25SJason Evansmutex_pool_init(mutex_pool_t *pool, const char *name, witness_rank_t rank) { 11*b7eaed25SJason Evans for (int i = 0; i < MUTEX_POOL_SIZE; ++i) { 12*b7eaed25SJason Evans if (malloc_mutex_init(&pool->mutexes[i], name, rank, 13*b7eaed25SJason Evans malloc_mutex_address_ordered)) { 14*b7eaed25SJason Evans return true; 15*b7eaed25SJason Evans } 16*b7eaed25SJason Evans } 17*b7eaed25SJason Evans return false; 18*b7eaed25SJason Evans } 19