source: rtems/cpukit/score/src/threadqprocesstimeout.c @ a112364

4.115
Last change on this file since a112364 was a112364, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 15:30:26

score: Create threadq implementation header

Move implementation specific parts of tqdata.h, threadq.h and
threadq.inl into new header file threadqimpl.h. The threadq.h contains
now only the application visible API.

Delete tqdata.h.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 * @file
3 *
4 * @brief Thread Queue Handler Process Timeout Handler
5 * @ingroup ScoreThreadQ
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/threadqimpl.h>
22#include <rtems/score/threadimpl.h>
23
24void _Thread_queue_Process_timeout(
25  Thread_Control *the_thread
26)
27{
28  Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
29
30  /*
31   *  If the_thread_queue is not synchronized, then it is either
32   *  "nothing happened", "timeout", or "satisfied".   If the_thread
33   *  is the executing thread, then it is in the process of blocking
34   *  and it is the thread which is responsible for the synchronization
35   *  process.
36   *
37   *  If it is not satisfied, then it is "nothing happened" and
38   *  this is the "timeout" transition.  After a request is satisfied,
39   *  a timeout is not allowed to occur.
40   */
41
42  if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
43       _Thread_Is_executing( the_thread ) ) {
44    if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
45      the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
46      the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
47    }
48  } else {
49    the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
50    _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
51  }
52}
53
Note: See TracBrowser for help on using the repository browser.