diff options
author | Jason Evans <je@fb.com> | 2012-03-13 16:31:41 -0700 |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-03-13 16:31:41 -0700 |
commit | 4e2e3dd9cf19ed5991938a708a8b50611aa5bbf8 (patch) | |
tree | 0bd52cef3ce19d84725e6018a5b41bc6cdb8de2a /include/jemalloc/internal/chunk_dss.h | |
parent | 824d34e5b7f5cf00bf472ec79f7ec1c6e3474114 (diff) | |
download | jemalloc-4e2e3dd9cf19ed5991938a708a8b50611aa5bbf8.tar.gz |
Fix fork-related bugs.
Acquire/release arena bin locks as part of the prefork/postfork. This
bug made deadlock in the child between fork and exec a possibility.
Split jemalloc_postfork() into jemalloc_postfork_{parent,child}() so
that the child can reinitialize mutexes rather than unlocking them. In
practice, this bug tended not to cause problems.
Diffstat (limited to 'include/jemalloc/internal/chunk_dss.h')
-rw-r--r-- | include/jemalloc/internal/chunk_dss.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/jemalloc/internal/chunk_dss.h b/include/jemalloc/internal/chunk_dss.h index 35cd461..a39a203 100644 --- a/include/jemalloc/internal/chunk_dss.h +++ b/include/jemalloc/internal/chunk_dss.h @@ -9,16 +9,13 @@ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS -/* - * Protects sbrk() calls. This avoids malloc races among threads, though it - * does not protect against races with threads that call sbrk() directly. - */ -extern malloc_mutex_t dss_mtx; - void *chunk_alloc_dss(size_t size, bool *zero); bool chunk_in_dss(void *chunk); bool chunk_dealloc_dss(void *chunk, size_t size); bool chunk_dss_boot(void); +void chunk_dss_prefork(void); +void chunk_dss_postfork_parent(void); +void chunk_dss_postfork_child(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ |