@@ -88,9 +88,8 @@ static inline void worker_barrier() {
88
88
}
89
89
90
90
91
- static void * tst_thread_dispatcher (void * arg )
92
- {
93
- struct tst_thread_env_t * thread_env = (struct tst_thread_env_t * ) arg ;
91
+ static void * tst_thread_dispatcher (void * arg ) {
92
+ struct tst_thread_env_t * thread_env = (struct tst_thread_env_t * ) arg ;
94
93
tst_thread_cmd_t local_cmd = TST_THREAD_CMD_NULL ;
95
94
int local_cmd_count = 0 ;
96
95
@@ -101,8 +100,7 @@ static void * tst_thread_dispatcher (void * arg)
101
100
/*
102
101
* Wait for tests to be dispatched and scheduled.
103
102
*/
104
- while (TST_THREAD_CMD_FINALIZE != local_cmd )
105
- {
103
+ while (TST_THREAD_CMD_FINALIZE != local_cmd ) {
106
104
const struct tst_env * env ;
107
105
108
106
pthread_mutex_lock (& cmd_mutex );
@@ -133,26 +131,20 @@ static void * tst_thread_dispatcher (void * arg)
133
131
tst_output_printf (DEBUG_LOG , TST_REPORT_MAX , "(Rank:%d; Thread:%d) tst_thread_dispatcher calling init\n" ,
134
132
tst_global_rank , thread_env -> thread_num );
135
133
thread_env -> tst_init_func (env );
136
-
137
- worker_done ();
138
134
break ;
139
135
140
136
case TST_THREAD_CMD_RUN :
141
137
thread_env -> state = TST_THREAD_STATE_CALLING_RUN ;
142
138
tst_output_printf (DEBUG_LOG , TST_REPORT_MAX , "(Rank:%d; Thread:%d) tst_thread_dispatcher calling run\n" ,
143
139
tst_global_rank , thread_env -> thread_num );
144
140
thread_env -> tst_run_func (env );
145
-
146
- worker_done ();
147
141
break ;
148
142
149
143
case TST_THREAD_CMD_CLEANUP :
150
144
thread_env -> state = TST_THREAD_STATE_CALLING_CLEANUP ;
151
145
tst_output_printf (DEBUG_LOG , TST_REPORT_MAX , "(Rank:%d; Thread:%d) tst_thread_dispatcher calling cleanup\n" ,
152
146
tst_global_rank , thread_env -> thread_num );
153
147
thread_env -> tst_cleanup_func (env );
154
-
155
- worker_done ();
156
148
break ;
157
149
158
150
case TST_THREAD_CMD_FINALIZE :
@@ -162,6 +154,7 @@ static void * tst_thread_dispatcher (void * arg)
162
154
ERROR (EINVAL , "Unhandled cmd" );
163
155
}
164
156
thread_env -> state = TST_THREAD_STATE_IDLE ;
157
+ worker_done ();
165
158
}
166
159
return NULL ;
167
160
}
0 commit comments