@@ -119,32 +119,28 @@ sge_worker_terminate() {
119119 * trigger pthread_cancel for each thread so that further
120120 * shutdown process will be faster
121121 */
122- {
123- cl_thread_list_elem_t *thr;
122+ cl_thread_list_elem_t *thr;
124123
125- cl_thread_list_elem_t *thr_nxt = cl_thread_list_get_first_elem (Main_Control.worker_thread_pool );
126- while ((thr = thr_nxt) != nullptr ) {
127- thr_nxt = cl_thread_list_get_next_elem (thr);
124+ cl_thread_list_elem_t *thr_nxt = cl_thread_list_get_first_elem (Main_Control.worker_thread_pool );
125+ while ((thr = thr_nxt) != nullptr ) {
126+ thr_nxt = cl_thread_list_get_next_elem (thr);
128127
129- cl_thread_shutdown (thr->thread_config );
130- }
128+ cl_thread_shutdown (thr->thread_config );
131129 }
132130
133131 sge_tq_wakeup_waiting (GlobalRequestQueue);
134132
135133 /*
136134 * Shutdown/delete the threads and wait for termination
137135 */
138- {
139- cl_thread_settings_t *thread = cl_thread_list_get_first_thread (Main_Control.worker_thread_pool );
140- while (thread != nullptr ) {
141- DPRINTF (" gets canceled\n " );
142- cl_thread_list_delete_thread (Main_Control.worker_thread_pool , thread);
136+ cl_thread_settings_t *thread = cl_thread_list_get_first_thread (Main_Control.worker_thread_pool );
137+ while (thread != nullptr ) {
138+ DPRINTF (" gets canceled\n " );
139+ cl_thread_list_delete_thread (Main_Control.worker_thread_pool , thread);
143140
144- thread = cl_thread_list_get_first_thread (Main_Control.worker_thread_pool );
145- }
146- DPRINTF (" all " SFN " threads terminated\n " , threadnames[WORKER_THREAD]);
141+ thread = cl_thread_list_get_first_thread (Main_Control.worker_thread_pool );
147142 }
143+ DPRINTF (" all " SFN " threads terminated\n " , threadnames[WORKER_THREAD]);
148144
149145 do_final_spooling = sge_qmaster_do_final_spooling ();
150146
@@ -173,6 +169,8 @@ sge_worker_terminate() {
173169 sge_shutdown_persistence (nullptr );
174170 DPRINTF (" persistence module has been shutdown\n " );
175171
172+ INFO (MSG_THREADPOOL_XTERMINATED_S, threadnames[WORKER_THREAD]);
173+
176174 DRETURN_VOID;
177175}
178176
0 commit comments