*/
pending = cputhreads = 0;
for_each_td(td, i) {
- int flags;
+ int flags = 0;
/*
* ->io_ops is NULL for a thread that has closed its
if (!td->pid || td->runstate == TD_REAPED)
continue;
+ if (td->use_thread) {
+ if (td->runstate == TD_EXITED) {
+ td_set_runstate(td, TD_REAPED);
+ goto reaped;
+ }
+ continue;
+ }
flags = WNOHANG;
if (td->runstate == TD_EXITED)
if (WIFEXITED(status)) {
if (WEXITSTATUS(status) && !td->error)
td->error = WEXITSTATUS(status);
- if (td->use_thread) {
- long ret;
- if (pthread_join(td->thread, (void *) &ret))
- perror("pthread_join");
- }
td_set_runstate(td, TD_REAPED);
goto reaped;
}
*/
continue;
reaped:
+ if (td->use_thread) {
+ long ret;
+
+ if (pthread_join(td->thread, (void *) &ret))
+ perror("pthread_join");
+ }
+
(*nr_running)--;
(*m_rate) -= td->ratemin;
(*t_rate) -= td->rate;