@@ -761,7 +761,7 @@ void jl_init_threading(void)
761761 gc_first_tid = nthreads + nthreadsi ;
762762}
763763
764- static uv_barrier_t thread_init_done ;
764+ uv_barrier_t thread_init_done ;
765765
766766void jl_start_threads (void )
767767{
@@ -800,28 +800,23 @@ void jl_start_threads(void)
800800 uv_barrier_init (& thread_init_done , nthreads );
801801
802802 // GC/System threads need to be after the worker threads.
803- int nworker_threads = nthreads - ngcthreads ;
803+ int nmutator_threads = nthreads - ngcthreads ;
804804
805805 for (i = 1 ; i < nthreads ; ++ i ) {
806- jl_threadarg_t * t = ( jl_threadarg_t * ) malloc_s ( sizeof ( jl_threadarg_t )); // ownership will be passed to the thread
807- t -> tid = i ;
808- t -> barrier = & thread_init_done ;
809- if ( i < nworker_threads ) {
806+ if ( i < nmutator_threads ) {
807+ jl_threadarg_t * t = ( jl_threadarg_t * ) malloc_s ( sizeof ( jl_threadarg_t )); // ownership will be passed to the thread
808+ t -> tid = i ;
809+ t -> barrier = & thread_init_done ;
810810 uv_thread_create (& uvtid , jl_threadfun , t );
811811 if (exclusive ) {
812812 mask [i ] = 1 ;
813813 uv_thread_setaffinity (& uvtid , mask , NULL , cpumasksize );
814814 mask [i ] = 0 ;
815815 }
816816 }
817- else if (i == nthreads - 1 && jl_n_sweepthreads == 1 ) {
818- uv_thread_create (& uvtid , jl_concurrent_gc_threadfun , t );
819- }
820- else {
821- uv_thread_create (& uvtid , jl_parallel_gc_threadfun , t );
822- }
823817 uv_thread_detach (& uvtid );
824818 }
819+ jl_spawn_gc_threads ();
825820
826821 uv_barrier_wait (& thread_init_done );
827822}
0 commit comments