diff options
author | Gedare Bloom <gedare@rtems.org> | 2016-06-09 11:33:15 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2016-07-25 12:44:47 -0400 |
commit | f23d4706169d68d3c4e90b297650f89c272716f4 (patch) | |
tree | 333bdc4b4be2ec4ad7ee80ee03229759ec60602a /cpukit/score/src/threadqenqueue.c | |
parent | 7f616dddcfe1943d1ef7526d8e055624a683e024 (diff) |
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/threadqenqueue.c')
-rw-r--r-- | cpukit/score/src/threadqenqueue.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index 3be7d58f16..088157d20c 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -39,7 +39,6 @@ void _Thread_queue_Enqueue_critical( const Thread_queue_Operations *operations, Thread_Control *the_thread, States_Control state, - Watchdog_Interval timeout, Thread_queue_Context *queue_context ) { @@ -83,13 +82,28 @@ void _Thread_queue_Enqueue_critical( /* * If the thread wants to timeout, then schedule its timer. */ - if ( timeout != WATCHDOG_NO_TIMEOUT ) { - _Thread_Timer_insert_relative( - the_thread, - cpu_self, - _Thread_Timeout, - timeout - ); + switch ( queue_context->timeout_discipline ) { + case WATCHDOG_RELATIVE: + /* A relative timeout of 0 is a special case indefinite (no) timeout */ + if ( queue_context->timeout != 0 ) { + _Thread_Timer_insert_relative( + the_thread, + cpu_self, + _Thread_Timeout, + (Watchdog_Interval) queue_context->timeout + ); + } + break; + case WATCHDOG_ABSOLUTE: + _Thread_Timer_insert_absolute( + the_thread, + cpu_self, + _Thread_Timeout, + queue_context->timeout + ); + break; + default: + break; } /* |