File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2133,6 +2133,23 @@ void
21332133arena_postfork_child (tsdn_t * tsdn , arena_t * arena ) {
21342134 unsigned i ;
21352135
2136+ atomic_store_u (& arena -> nthreads [0 ], 0 , ATOMIC_RELAXED );
2137+ atomic_store_u (& arena -> nthreads [1 ], 0 , ATOMIC_RELAXED );
2138+ if (tsd_arena_get (tsdn_tsd (tsdn )) == arena ) {
2139+ arena_nthreads_inc (arena , false);
2140+ }
2141+ if (tsd_iarena_get (tsdn_tsd (tsdn )) == arena ) {
2142+ arena_nthreads_inc (arena , true);
2143+ }
2144+ if (config_stats ) {
2145+ ql_new (& arena -> tcache_ql );
2146+ tcache_t * tcache = tcache_get (tsdn_tsd (tsdn ));
2147+ if (tcache != NULL && tcache -> arena == arena ) {
2148+ ql_elm_new (tcache , link );
2149+ ql_tail_insert (& arena -> tcache_ql , tcache , link );
2150+ }
2151+ }
2152+
21362153 for (i = 0 ; i < NBINS ; i ++ ) {
21372154 malloc_mutex_postfork_child (tsdn , & arena -> bins [i ].lock );
21382155 }
You can’t perform that action at this time.
0 commit comments