Reviewed-by: Honnappa Nagarahalli <[email protected]>
On 13 April 2017 at 21:57, Kevin Wang <[email protected]> wrote: > For different scheduler sync type, need to call different release > function. > > Signed-off-by: Kevin Wang <[email protected]> > --- > test/common_plat/validation/api/scheduler/scheduler.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/test/common_plat/validation/api/scheduler/scheduler.c > b/test/common_plat/validation/api/scheduler/scheduler.c > index 952561c..2c669a1 100644 > --- a/test/common_plat/validation/api/scheduler/scheduler.c > +++ b/test/common_plat/validation/api/scheduler/scheduler.c > @@ -129,6 +129,14 @@ static int exit_schedule_loop(void) > return ret; > } > > +static void release_context(odp_schedule_sync_t sync) > +{ > + if (sync == ODP_SCHED_SYNC_ATOMIC) > + odp_schedule_release_atomic(); > + else if (sync == ODP_SCHED_SYNC_ORDERED) > + odp_schedule_release_ordered(); > +} > + > void scheduler_test_wait_time(void) > { > int i; > @@ -251,8 +259,7 @@ void scheduler_test_queue_destroy(void) > CU_ASSERT_FATAL(u32[0] == MAGIC); > > odp_buffer_free(buf); > - odp_schedule_release_ordered(); > - > + release_context(qp.sched.sync); > CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0); > } > > @@ -820,12 +827,7 @@ static int schedule_common_(void *arg) > } > } > > - if (sync == ODP_SCHED_SYNC_ATOMIC) > - odp_schedule_release_atomic(); > - > - if (sync == ODP_SCHED_SYNC_ORDERED) > - odp_schedule_release_ordered(); > - > + release_context(sync); > odp_ticketlock_lock(&globals->lock); > > globals->buf_count -= num; > -- > 2.7.4 >
