summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/condition.c
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2016-06-09 11:33:15 -0400
committerGedare Bloom <gedare@rtems.org>2016-07-25 12:44:47 -0400
commitf23d4706169d68d3c4e90b297650f89c272716f4 (patch)
tree333bdc4b4be2ec4ad7ee80ee03229759ec60602a /cpukit/score/src/condition.c
parentscore: Fix for RTEMS_DEBUG (diff)
downloadrtems-f23d4706169d68d3c4e90b297650f89c272716f4.tar.bz2
cpukit: Add and use Watchdog_Discipline.
Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE, or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline of WATCHDOG_NO_TIMEOUT. updates #2732
Diffstat (limited to 'cpukit/score/src/condition.c')
-rw-r--r--cpukit/score/src/condition.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c
index e7d98058a0..90717bc93e 100644
--- a/cpukit/score/src/condition.c
+++ b/cpukit/score/src/condition.c
@@ -82,7 +82,6 @@ static void _Condition_Queue_release(
static Per_CPU_Control *_Condition_Do_wait(
struct _Condition_Control *_condition,
- Watchdog_Interval timeout,
Thread_queue_Context *queue_context
)
{
@@ -100,7 +99,6 @@ static Per_CPU_Control *_Condition_Do_wait(
CONDITION_TQ_OPERATIONS,
executing,
STATES_WAITING_FOR_SYS_LOCK_CONDITION,
- timeout,
queue_context
);
@@ -117,7 +115,11 @@ void _Condition_Wait(
_Thread_queue_Context_initialize( &queue_context );
_ISR_lock_ISR_disable( &queue_context.Lock_context );
- cpu_self = _Condition_Do_wait( _condition, 0, &queue_context );
+ _Thread_queue_Context_set_no_timeout( &queue_context );
+ cpu_self = _Condition_Do_wait(
+ _condition,
+ &queue_context
+ );
_Mutex_Release( _mutex );
_Thread_Dispatch_enable( cpu_self );
@@ -151,7 +153,8 @@ int _Condition_Wait_timed(
break;
}
- cpu_self = _Condition_Do_wait( _condition, ticks, &queue_context );
+ _Thread_queue_Context_set_relative_timeout( &queue_context, ticks );
+ cpu_self = _Condition_Do_wait( _condition, &queue_context );
_Mutex_Release( _mutex );
executing = cpu_self->executing;
@@ -173,7 +176,8 @@ void _Condition_Wait_recursive(
_Thread_queue_Context_initialize( &queue_context );
_ISR_lock_ISR_disable( &queue_context.Lock_context );
- cpu_self = _Condition_Do_wait( _condition, 0, &queue_context );
+ _Thread_queue_Context_set_no_timeout( &queue_context );
+ cpu_self = _Condition_Do_wait( _condition, &queue_context );
nest_level = _mutex->_nest_level;
_mutex->_nest_level = 0;
@@ -211,7 +215,8 @@ int _Condition_Wait_recursive_timed(
break;
}
- cpu_self = _Condition_Do_wait( _condition, ticks, &queue_context );
+ _Thread_queue_Context_set_relative_timeout( &queue_context, ticks );
+ cpu_self = _Condition_Do_wait( _condition, &queue_context );
nest_level = _mutex->_nest_level;
_mutex->_nest_level = 0;