[rtems commit] smptests/smpscheduler03: Use proper lock
Sebastian Huber
sebh at rtems.org
Wed Jun 3 08:08:18 UTC 2015
Module: rtems
Branch: master
Commit: f48b73deb6c7958478b6fbaeb9a27483c6eb00b3
Changeset: http://git.rtems.org/rtems/commit/?id=f48b73deb6c7958478b6fbaeb9a27483c6eb00b3
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jun 2 14:10:05 2015 +0200
smptests/smpscheduler03: Use proper lock
---
testsuites/smptests/smpscheduler03/init.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c
index 3a068a2..4a3aa54 100644
--- a/testsuites/smptests/smpscheduler03/init.c
+++ b/testsuites/smptests/smpscheduler03/init.c
@@ -195,9 +195,9 @@ static Thread_Control *change_priority_op(
{
const Scheduler_Control *scheduler = _Scheduler_Get(thread);
Thread_Control *needs_help;
- ISR_Level level;
+ ISR_lock_Context lock_context;
- _ISR_Disable( level );
+ _Scheduler_Acquire(thread, &lock_context);
thread->current_priority = new_priority;
needs_help = (*scheduler->Operations.change_priority)(
scheduler,
@@ -205,7 +205,7 @@ static Thread_Control *change_priority_op(
new_priority,
prepend_it
);
- _ISR_Enable( level );
+ _Scheduler_Release(thread, &lock_context);
return needs_help;
}
@@ -430,22 +430,22 @@ static void test_yield_op(void)
static void block_op(Thread_Control *thread)
{
const Scheduler_Control *scheduler = _Scheduler_Get(thread);
- ISR_Level level;
+ ISR_lock_Context lock_context;
- _ISR_Disable( level );
+ _Scheduler_Acquire(thread, &lock_context);
(*scheduler->Operations.block)(scheduler, thread);
- _ISR_Enable( level );
+ _Scheduler_Release(thread, &lock_context);
}
static Thread_Control *unblock_op(Thread_Control *thread)
{
const Scheduler_Control *scheduler = _Scheduler_Get(thread);
Thread_Control *needs_help;
- ISR_Level level;
+ ISR_lock_Context lock_context;
- _ISR_Disable( level );
+ _Scheduler_Acquire(thread, &lock_context);
needs_help = (*scheduler->Operations.unblock)(scheduler, thread);
- _ISR_Enable( level );
+ _Scheduler_Release(thread, &lock_context);
return needs_help;
}
More information about the vc
mailing list