From 0d733e2d2229ffd3dde05a324227ee45e0f37c44 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Wed, 17 Feb 2016 18:06:19 +0100 Subject: release_t: add -W option --- bin/release_ts.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/release_ts.c b/bin/release_ts.c index feca5ef..661099e 100644 --- a/bin/release_ts.c +++ b/bin/release_ts.c @@ -9,7 +9,7 @@ #include "litmus.h" #include "internal.h" -#define OPTSTR "d:wf:" +#define OPTSTR "d:wf:W" #define LITMUS_STATS_FILE "/proc/litmus/stats" @@ -22,6 +22,7 @@ void usage(char *error) { " -w wait until all tasks are ready for release\n" " (as determined by /proc/litmus/stats\n" " -f <#tasks> wait for #tasks (default: 0)\n" + " -W just wait, don't actually release tasks\n" "\n", error); exit(1); @@ -46,8 +47,9 @@ int main(int argc, char** argv) lt_t delay = ms2ns(1000); int wait = 0; int expected = 0; + int exit_after_wait = 0; int opt; - + while ((opt = getopt(argc, argv, OPTSTR)) != -1) { switch (opt) { case 'd': @@ -56,6 +58,10 @@ int main(int argc, char** argv) case 'w': wait = 1; break; + case 'W': + wait = 1; + exit_after_wait = 1; + break; case 'f': wait = 1; expected = atoi(optarg); @@ -73,12 +79,15 @@ int main(int argc, char** argv) if (wait) wait_until_ready(expected); + if (exit_after_wait) + exit(0); + released = release_ts(&delay); if (released < 0) { perror("release task system"); exit(1); } - + printf("Released %d real-time tasks.\n", released); return 0; -- cgit v1.2.2