diff options
author | Matias Elo <matias.elo@nokia.com> | 2019-04-25 13:21:26 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2019-05-14 16:01:43 +0300 |
commit | d2a23dc8a06ec974cb0254440143b8dab432e3fc (patch) | |
tree | e4b24a15894fefabc3ae795ac22c822b401b51d9 /test/validation/api/scheduler | |
parent | ff1c6ceb92f014785ec4d90a4bd2ec6802a18bab (diff) |
validation: scheduler: run multithread tests also on core zero
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
Diffstat (limited to 'test/validation/api/scheduler')
-rw-r--r-- | test/validation/api/scheduler/scheduler.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 848c683b3..0215ecf1d 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -979,7 +979,6 @@ static void chaos_run(unsigned int qtype) CU_ASSERT_PTR_NOT_NULL_FATAL(args); args->globals = globals; - args->cu_thr.numthrds = globals->num_workers; odp_queue_param_init(&qp); odp_pool_param_init(¶ms); @@ -1025,17 +1024,20 @@ static void chaos_run(unsigned int qtype) CU_ASSERT_FATAL(rc == 0); } - /* Run the test */ - odp_cunit_thread_create(chaos_thread, &args->cu_thr); - odp_cunit_thread_exit(&args->cu_thr); + /* Test runs also on the main thread */ + args->cu_thr.numthrds = globals->num_workers - 1; + if (args->cu_thr.numthrds > 0) + odp_cunit_thread_create(chaos_thread, &args->cu_thr); + + chaos_thread(args); + + if (args->cu_thr.numthrds > 0) + odp_cunit_thread_exit(&args->cu_thr); if (CHAOS_DEBUG) printf("Thread %d returning from chaos threads..cleaning up\n", odp_thread_id()); - drain_queues(); - exit_schedule_loop(); - for (i = 0; i < CHAOS_NUM_QUEUES; i++) { if (CHAOS_DEBUG) printf("Destroying queue %s\n", @@ -1457,11 +1459,17 @@ static void parallel_execute(odp_schedule_sync_t sync, int num_queues, fill_queues(args); /* Create and launch worker threads */ - args->cu_thr.numthrds = globals->num_workers; - odp_cunit_thread_create(schedule_common_, &args->cu_thr); + + /* Test runs also on the main thread */ + args->cu_thr.numthrds = globals->num_workers - 1; + if (args->cu_thr.numthrds > 0) + odp_cunit_thread_create(schedule_common_, &args->cu_thr); + + schedule_common_(args); /* Wait for worker threads to terminate */ - odp_cunit_thread_exit(&args->cu_thr); + if (args->cu_thr.numthrds > 0) + odp_cunit_thread_exit(&args->cu_thr); /* Cleanup ordered queues for next pass */ if (sync == ODP_SCHED_SYNC_ORDERED) |