Skip to content

Commit

Permalink
Avoid duplicate thread recycling.
Browse files Browse the repository at this point in the history
    At the end of the test, the traffic thread has been reclaimed.
If there is an exception in the control connection, it will cause
the thread to be reclaimed repeatedly.
Use sp->done to avoid repeated thread recycling.
  • Loading branch information
jiangjixiang committed Sep 18, 2024
1 parent 7679199 commit 7bd583d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/iperf_client_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ iperf_run_client(struct iperf_test * test)
/* Cancel all outstanding threads */
i_errno_save = i_errno;
SLIST_FOREACH(sp, &test->streams, streams) {
if (sp->done) {
continue;
}
sp->done = 1;
int rc;
rc = pthread_cancel(sp->thr);
Expand Down

0 comments on commit 7bd583d

Please sign in to comment.