@@ -2198,20 +2198,32 @@ prof_boot2(void)
21982198}
21992199
22002200void
2201- prof_prefork (void )
2201+ prof_prefork0 (void )
22022202{
22032203
22042204 if (opt_prof ) {
22052205 unsigned i ;
22062206
2207- malloc_mutex_prefork (& tdatas_mtx );
2207+ malloc_mutex_prefork (& prof_dump_mtx );
22082208 malloc_mutex_prefork (& bt2gctx_mtx );
2209- malloc_mutex_prefork (& next_thr_uid_mtx );
2210- malloc_mutex_prefork (& prof_dump_seq_mtx );
2211- for (i = 0 ; i < PROF_NCTX_LOCKS ; i ++ )
2212- malloc_mutex_prefork (& gctx_locks [i ]);
2209+ malloc_mutex_prefork (& tdatas_mtx );
22132210 for (i = 0 ; i < PROF_NTDATA_LOCKS ; i ++ )
22142211 malloc_mutex_prefork (& tdata_locks [i ]);
2212+ for (i = 0 ; i < PROF_NCTX_LOCKS ; i ++ )
2213+ malloc_mutex_prefork (& gctx_locks [i ]);
2214+ }
2215+ }
2216+
2217+ void
2218+ prof_prefork1 (void )
2219+ {
2220+
2221+ if (opt_prof ) {
2222+ malloc_mutex_prefork (& prof_active_mtx );
2223+ malloc_mutex_prefork (& prof_dump_seq_mtx );
2224+ malloc_mutex_prefork (& prof_gdump_mtx );
2225+ malloc_mutex_prefork (& next_thr_uid_mtx );
2226+ malloc_mutex_prefork (& prof_thread_active_init_mtx );
22152227 }
22162228}
22172229
@@ -2222,14 +2234,18 @@ prof_postfork_parent(void)
22222234 if (opt_prof ) {
22232235 unsigned i ;
22242236
2225- for (i = 0 ; i < PROF_NTDATA_LOCKS ; i ++ )
2226- malloc_mutex_postfork_parent (& tdata_locks [i ]);
2237+ malloc_mutex_postfork_parent (& prof_thread_active_init_mtx );
2238+ malloc_mutex_postfork_parent (& next_thr_uid_mtx );
2239+ malloc_mutex_postfork_parent (& prof_gdump_mtx );
2240+ malloc_mutex_postfork_parent (& prof_dump_seq_mtx );
2241+ malloc_mutex_postfork_parent (& prof_active_mtx );
22272242 for (i = 0 ; i < PROF_NCTX_LOCKS ; i ++ )
22282243 malloc_mutex_postfork_parent (& gctx_locks [i ]);
2229- malloc_mutex_postfork_parent (& prof_dump_seq_mtx );
2230- malloc_mutex_postfork_parent (& next_thr_uid_mtx );
2231- malloc_mutex_postfork_parent (& bt2gctx_mtx );
2244+ for (i = 0 ; i < PROF_NTDATA_LOCKS ; i ++ )
2245+ malloc_mutex_postfork_parent (& tdata_locks [i ]);
22322246 malloc_mutex_postfork_parent (& tdatas_mtx );
2247+ malloc_mutex_postfork_parent (& bt2gctx_mtx );
2248+ malloc_mutex_postfork_parent (& prof_dump_mtx );
22332249 }
22342250}
22352251
@@ -2240,14 +2256,18 @@ prof_postfork_child(void)
22402256 if (opt_prof ) {
22412257 unsigned i ;
22422258
2243- for (i = 0 ; i < PROF_NTDATA_LOCKS ; i ++ )
2244- malloc_mutex_postfork_child (& tdata_locks [i ]);
2259+ malloc_mutex_postfork_child (& prof_thread_active_init_mtx );
2260+ malloc_mutex_postfork_child (& next_thr_uid_mtx );
2261+ malloc_mutex_postfork_child (& prof_gdump_mtx );
2262+ malloc_mutex_postfork_child (& prof_dump_seq_mtx );
2263+ malloc_mutex_postfork_child (& prof_active_mtx );
22452264 for (i = 0 ; i < PROF_NCTX_LOCKS ; i ++ )
22462265 malloc_mutex_postfork_child (& gctx_locks [i ]);
2247- malloc_mutex_postfork_child (& prof_dump_seq_mtx );
2248- malloc_mutex_postfork_child (& next_thr_uid_mtx );
2249- malloc_mutex_postfork_child (& bt2gctx_mtx );
2266+ for (i = 0 ; i < PROF_NTDATA_LOCKS ; i ++ )
2267+ malloc_mutex_postfork_child (& tdata_locks [i ]);
22502268 malloc_mutex_postfork_child (& tdatas_mtx );
2269+ malloc_mutex_postfork_child (& bt2gctx_mtx );
2270+ malloc_mutex_postfork_child (& prof_dump_mtx );
22512271 }
22522272}
22532273
0 commit comments