mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-17 01:15:39 +03:00
Header refactoring: unify and de-catchall mutex module
This commit is contained in:
parent
9f822a1fd7
commit
18ecbfa89e
34 changed files with 304 additions and 287 deletions
12
src/tsd.c
12
src/tsd.c
|
|
@ -3,6 +3,7 @@
|
|||
#include "jemalloc/internal/jemalloc_internal_includes.h"
|
||||
|
||||
#include "jemalloc/internal/assert.h"
|
||||
#include "jemalloc/internal/mutex.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* Data. */
|
||||
|
|
@ -23,6 +24,17 @@ DWORD tsd_tsd;
|
|||
tsd_wrapper_t tsd_boot_wrapper = {false, TSD_INITIALIZER};
|
||||
bool tsd_booted = false;
|
||||
#else
|
||||
|
||||
/*
|
||||
* This contains a mutex, but it's pretty convenient to allow the mutex code to
|
||||
* have a dependency on tsd. So we define the struct here, and only refer to it
|
||||
* by pointer in the header.
|
||||
*/
|
||||
struct tsd_init_head_s {
|
||||
ql_head(tsd_init_block_t) blocks;
|
||||
malloc_mutex_t lock;
|
||||
};
|
||||
|
||||
pthread_key_t tsd_tsd;
|
||||
tsd_init_head_t tsd_init_head = {
|
||||
ql_head_initializer(blocks),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue