diff options
author | John Kacur <jkacur@redhat.com> | 2009-09-14 16:38:31 +0200 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-09-15 09:39:52 +0200 |
commit | 3613b20a6579e1ad41a289c225fbfc9e04014ccc (patch) | |
tree | 828b982cab831aeab217e7379e259ee51be23a1e | |
parent | e9455e4dba8b872c21038ef4fff7c0caa75c95ac (diff) | |
download | rt-tests-3613b20a6579e1ad41a289c225fbfc9e04014ccc.tar.gz rt-tests-3613b20a6579e1ad41a289c225fbfc9e04014ccc.tar.xz |
pi_stress: rename cleanup() to set_shutdown_flag()
That name matches the actual action of that function.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | src/pi_tests/pi_stress.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index ead2d0a..89de656 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -230,7 +230,7 @@ void process_command_line(int argc, char **argv); void usage(void); int block_signals(void); int allow_sigterm(void); -void cleanup(void); +void set_shutdown_flag(void); int initialize_group(struct group_parameters *group); int create_group(struct group_parameters *group); unsigned long total_inversions(void); @@ -332,7 +332,7 @@ main (int argc, char **argv) status = pthread_barrier_wait(&all_threads_ready); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { error("main: pthread_barrier_wait(all_threads_ready): 0x%x\n", status); - cleanup(); + set_shutdown_flag(); return FAILURE; } @@ -342,7 +342,7 @@ main (int argc, char **argv) fputs(DOWN_ONE, stdout); printf("Stopping test\n"); } - cleanup(); + set_shutdown_flag(); // wait for all threads to notice the shutdown flag if (have_errors == 0 && interrupted == 0) { @@ -560,7 +560,7 @@ reporter(void *arg) // if we specified a duration, see if it has expired if (end && time(NULL) > end) { info("duration reached (%d seconds)\n", duration); - cleanup(); + set_shutdown_flag(); continue; } @@ -573,7 +573,7 @@ reporter(void *arg) // check watchdog stuff if ((watchdog_check())) { error("reporter stopping due to watchdog event\n"); - cleanup(); + set_shutdown_flag(); break; } @@ -582,7 +582,7 @@ reporter(void *arg) } debug("reporter: finished\n"); - cleanup(); + set_shutdown_flag(); return NULL; } @@ -671,7 +671,7 @@ low_priority(void *arg) return NULL; } } - cleanup(); + set_shutdown_flag(); debug("low_priority[%d]: entering done barrier\n", p->id); /* wait for all threads to finish */ status = pthread_barrier_wait(&all_threads_done); @@ -734,7 +734,7 @@ med_priority(void *arg) return NULL; } } - cleanup(); + set_shutdown_flag(); debug("med_priority[%d]: entering done barrier\n", p->id); /* wait for all threads to finish */ @@ -812,7 +812,7 @@ high_priority(void *arg) p->watchdog++; } - cleanup(); + set_shutdown_flag(); debug("high_priority[%d]: entering done barrier\n", p->id); @@ -929,9 +929,8 @@ allow_sigterm(void) return SUCCESS; } -// clean up before exiting -void -cleanup(void) +/* clean up before exiting */ +void set_shutdown_flag(void) { if (shutdown == 0) { // tell anyone that's looking that we're done @@ -1045,7 +1044,7 @@ create_group(struct group_parameters *group) group); if (status != 0) { error("creating high_priority thread: %s\n", strerror(status)); - cleanup(); + set_shutdown_flag(); return FAILURE; } return SUCCESS; |