summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rt-app.c4
-rw-r--r--src/rt-app_parse_config.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/rt-app.c b/src/rt-app.c
index d361bee..0c8f170 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -481,14 +481,12 @@ int main(int argc, char* argv[])
/* start threads */
for (i = 0; i < nthreads; i++) {
tdata = &opts.threads_data[i];
- if (opts.spacing > 0 ) {
+ if (!tdata->wait_before_start && (opts.spacing > 0)) {
/* start the thread, then it will sleep accordingly
* to its position. We don't sleep here anymore as
* this would mean that
* duration = spacing * nthreads + duration */
tdata->wait_before_start = opts.spacing * (i+1);
- } else {
- tdata->wait_before_start = 0;
}
tdata->duration = opts.duration;
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c
index 50faa56..952d390 100644
--- a/src/rt-app_parse_config.c
+++ b/src/rt-app_parse_config.c
@@ -391,6 +391,9 @@ parse_thread_data(char *name, struct json_object *obj, int idx,
data->sched_prio = get_int_value_from(obj, "priority", TRUE,
DEFAULT_THREAD_PRIORITY);
+ /* delay */
+ data->wait_before_start = get_int_value_from(obj, "delay", TRUE, 0);
+
/* cpu set */
cpuset_obj = get_in_object(obj, "cpus", TRUE);
if (cpuset_obj) {