diff options
author | Bill Fischofer <bill.fischofer@linaro.org> | 2014-11-17 17:19:02 -0600 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-11-20 11:59:52 +0300 |
commit | b9318299d307c37f7a092631f2f6a5f3846c8dd0 (patch) | |
tree | 0b563f9f99b8891f4f4d6ed3197320a5c8c539a2 /example | |
parent | 7e7b448a319f5654e89069a4d1d31af9bcc5986c (diff) |
API name changes for odp_barrier.h for ODP v1.0
2 patches from mailing list:
- API name changes for odp_barrier.h for ODP v1.0
- Update examples for odp_barrier.h API changes for ODP v1.0
This patch updates example programs to reflect API name changes in
odp_barrier.h for ODP v1.0
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r-- | example/ipsec/odp_ipsec.c | 4 | ||||
-rw-r--r-- | example/odp_example/odp_example.c | 46 | ||||
-rw-r--r-- | example/timer/odp_timer_test.c | 4 |
3 files changed, 27 insertions, 27 deletions
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 807ca7ef7..ec115fc39 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1048,7 +1048,7 @@ void *pktio_thread(void *arg ODP_UNUSED) printf("Pktio thread [%02i] starts\n", thr); - odp_barrier_sync(&sync_barrier); + odp_barrier_wait(&sync_barrier); /* Loop packets */ for (;;) { @@ -1230,7 +1230,7 @@ main(int argc, char *argv[]) printf("Num worker threads: %i\n", num_workers); /* Create a barrier to synchronize thread startup */ - odp_barrier_init_count(&sync_barrier, num_workers); + odp_barrier_init(&sync_barrier, num_workers); /* * By default core #0 runs Linux kernel background tasks. diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index 5fe2a993c..9e7f0903c 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -356,7 +356,7 @@ static int test_schedule_one_single(const char *str, int thr, ns = odp_time_cycles_to_ns(cycles); tot = i; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -417,7 +417,7 @@ static int test_schedule_one_many(const char *str, int thr, ns = odp_time_cycles_to_ns(cycles); tot = i; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -492,7 +492,7 @@ static int test_schedule_single(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -571,7 +571,7 @@ static int test_schedule_many(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -680,7 +680,7 @@ static int test_schedule_multi(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); if (tot) { @@ -729,10 +729,10 @@ static void *run_thread(void *arg) /* * Test barriers back-to-back */ - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); /* * Find the buffer pool @@ -744,48 +744,48 @@ static void *run_thread(void *arg) return NULL; } - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_alloc_single(thr, msg_pool)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_alloc_multi(thr, msg_pool)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_poll_queue(thr, msg_pool)) return NULL; /* Low prio */ - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_single("sched_one_s_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_single("sched_____s_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_many("sched_one_m_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_many("sched_____m_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_multi("sched_multi_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) @@ -793,31 +793,31 @@ static void *run_thread(void *arg) /* High prio */ - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_single("sched_one_s_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_single("sched_____s_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_many("sched_one_m_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_many("sched_____m_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_multi("sched_multi_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) @@ -1110,7 +1110,7 @@ int main(int argc, char *argv[]) odp_shm_print_all(); /* Barrier to sync test case execution */ - odp_barrier_init_count(&globals->barrier, num_workers); + odp_barrier_init(&globals->barrier, num_workers); if (args.proc_mode) { int ret; diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 04b4d89ed..9968bfe53 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -137,7 +137,7 @@ static void *run_thread(void *ptr) return NULL; } - odp_barrier_sync(&test_barrier); + odp_barrier_wait(&test_barrier); test_abs_timeouts(thr, args); @@ -374,7 +374,7 @@ int main(int argc, char *argv[]) printf("\n"); /* Barrier to sync test case execution */ - odp_barrier_init_count(&test_barrier, num_workers); + odp_barrier_init(&test_barrier, num_workers); /* Create and launch worker threads */ odph_linux_pthread_create(thread_tbl, num_workers, first_core, |