From f23d4706169d68d3c4e90b297650f89c272716f4 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Thu, 9 Jun 2016 11:33:15 -0400 Subject: 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 --- cpukit/score/src/condition.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'cpukit/score/src/condition.c') 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; -- cgit v1.2.3