diff options
author | Yuji Mano <yuji.mano@am.sony.com> | 2009-05-28 15:08:19 -0700 |
---|---|---|
committer | Yuji Mano <yuji.mano@am.sony.com> | 2009-05-28 15:08:19 -0700 |
commit | aa28cc081ee2ac6c98ab5b2ca039d9e855b80e1c (patch) | |
tree | 172b7d1180b216dc7280185d117b48df47b88caf | |
parent | b599e88ee6b09ee052457dac76e88f0e17a64452 (diff) | |
download | mars-src-aa28cc081ee2ac6c98ab5b2ca039d9e855b80e1c.tar.gz |
tests: Update branch-1.1.3
-rw-r--r-- | tests/TFP/TFP_4I_008/host.c | 13 | ||||
-rw-r--r-- | tests/TPF/TPF_60_003/Makefile | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/TFP/TFP_4I_008/host.c b/tests/TFP/TFP_4I_008/host.c index ad17012..1221104 100644 --- a/tests/TFP/TFP_4I_008/host.c +++ b/tests/TFP/TFP_4I_008/host.c @@ -53,7 +53,7 @@ static struct queue_entry data[Q_DEPTH]; static pthread_t thread[Q_DEPTH]; -static uint32_t counter[NUM_LOOP]; +static pthread_barrier_t barrier; static void *thread_proc(void *ptr) { @@ -61,9 +61,8 @@ static void *thread_proc(void *ptr) struct mars_task_args *task_args = (struct mars_task_args *)ptr; uint32_t id = task_args->type.u32[0]; uint32_t num = task_args->type.u32[1]; - uint32_t count = task_args->type.u32[2]; - mars_test_counter_wait(&counter[id], count); + pthread_barrier_wait(&barrier); cont = 1024; while (cont) { @@ -95,6 +94,7 @@ int main(void) MARS_TEST_ASSERT_ERROR(ret, MARS_SUCCESS); for (i = 0; i < NUM_LOOP; i++) { + ret = mars_task_queue_create( mars_ctx, &mpu_to_host, @@ -103,14 +103,14 @@ int main(void) MARS_TASK_QUEUE_MPU_TO_HOST); MARS_TEST_ASSERT_ERROR(ret, MARS_SUCCESS); - mars_test_counter_set(&counter[i], 0); + ret = pthread_barrier_init(&barrier, NULL, depth_size[i]); + MARS_TEST_ASSERT_EQUAL_INT(ret, 0); for (num = 0; num < depth_size[i]; num++) { /* create peek thread */ /* all threads will peek the same queue */ thread_args[num].type.u32[0] = (uint32_t)i; thread_args[num].type.u32[1] = num; - thread_args[num].type.u32[2] = depth_size[i]; pthread_create(&thread[num], NULL, thread_proc, &thread_args[num]); } @@ -133,6 +133,9 @@ int main(void) for (num = 0; num < depth_size[i]; num++) pthread_join(thread[num], NULL); + ret = pthread_barrier_destroy(&barrier); + MARS_TEST_ASSERT_EQUAL_INT(ret, 0); + ret = mars_task_destroy(&task_id); MARS_TEST_ASSERT_ERROR(ret, MARS_SUCCESS); diff --git a/tests/TPF/TPF_60_003/Makefile b/tests/TPF/TPF_60_003/Makefile index 8aca921..a40546c 100644 --- a/tests/TPF/TPF_60_003/Makefile +++ b/tests/TPF/TPF_60_003/Makefile @@ -27,7 +27,7 @@ MPU_INCLUDE_CFLAGS+= -I./ top_srcdir = ../.. test_objs = host.o mpu1.task_eo -timeout = 1200 +timeout = 1800 include $(top_srcdir)/scripts/config.mk include $(top_srcdir)/scripts/rules_item.mk |