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