diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-07 12:53:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-11 10:58:09 +0100 |
commit | 28779c70ffebbb2006eb7df01d64180859bb324e (patch) | |
tree | 18a8a77fce926492c090ca2bea21904d743adeb6 /testsuites/smptests/smplock01 | |
parent | score: Add local context to SMP lock API (diff) | |
download | rtems-28779c70ffebbb2006eb7df01d64180859bb324e.tar.bz2 |
score: Add function to destroy SMP locks
Diffstat (limited to 'testsuites/smptests/smplock01')
-rw-r--r-- | testsuites/smptests/smplock01/init.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/testsuites/smptests/smplock01/init.c b/testsuites/smptests/smplock01/init.c index d67d7bc07e..7c536c304c 100644 --- a/testsuites/smptests/smplock01/init.c +++ b/testsuites/smptests/smplock01/init.c @@ -138,15 +138,19 @@ static void test_2_body( ) { unsigned long counter = 0; - SMP_lock_Control lock = SMP_LOCK_INITIALIZER; + SMP_lock_Control lock; SMP_lock_Context lock_context; + _SMP_lock_Initialize(&lock); + while (assert_state(ctx, START_TEST)) { _SMP_lock_Acquire(&lock, &lock_context); _SMP_lock_Release(&lock, &lock_context); ++counter; } + _SMP_lock_Destroy(&lock); + ctx->test_counter[test][cpu_self] = counter; } @@ -159,9 +163,11 @@ static void test_3_body( ) { unsigned long counter = 0; - SMP_lock_Control lock = SMP_LOCK_INITIALIZER; + SMP_lock_Control lock; SMP_lock_Context lock_context; + _SMP_lock_Initialize(&lock); + while (assert_state(ctx, START_TEST)) { _SMP_lock_Acquire(&lock, &lock_context); @@ -172,6 +178,8 @@ static void test_3_body( ++counter; } + _SMP_lock_Destroy(&lock); + ctx->test_counter[test][cpu_self] = counter; } |