mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
Add lock to protect prof last-N dumping
This commit is contained in:
@@ -1116,6 +1116,7 @@ prof_prefork0(tsdn_t *tsdn) {
|
||||
for (i = 0; i < PROF_NCTX_LOCKS; i++) {
|
||||
malloc_mutex_prefork(tsdn, &gctx_locks[i]);
|
||||
}
|
||||
malloc_mutex_prefork(tsdn, &prof_recent_dump_mtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1145,6 +1146,7 @@ prof_postfork_parent(tsdn_t *tsdn) {
|
||||
malloc_mutex_postfork_parent(tsdn, &prof_dump_filename_mtx);
|
||||
malloc_mutex_postfork_parent(tsdn, &prof_active_mtx);
|
||||
counter_postfork_parent(tsdn, &prof_idump_accumulated);
|
||||
malloc_mutex_postfork_parent(tsdn, &prof_recent_dump_mtx);
|
||||
for (i = 0; i < PROF_NCTX_LOCKS; i++) {
|
||||
malloc_mutex_postfork_parent(tsdn, &gctx_locks[i]);
|
||||
}
|
||||
@@ -1170,6 +1172,7 @@ prof_postfork_child(tsdn_t *tsdn) {
|
||||
malloc_mutex_postfork_child(tsdn, &prof_dump_filename_mtx);
|
||||
malloc_mutex_postfork_child(tsdn, &prof_active_mtx);
|
||||
counter_postfork_child(tsdn, &prof_idump_accumulated);
|
||||
malloc_mutex_postfork_child(tsdn, &prof_recent_dump_mtx);
|
||||
for (i = 0; i < PROF_NCTX_LOCKS; i++) {
|
||||
malloc_mutex_postfork_child(tsdn, &gctx_locks[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user