source: rtems/cpukit/score/src/threadqprocesstimeout.c @ 4fc370e

4.115
Last change on this file since 4fc370e was bf54252, checked in by Alexandre Devienne <deviennealexandre@…>, on 11/28/12 at 20:14:50

Score misc: Clean up Doxygen #4 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7985215

  • Property mode set to 100644
File size: 1.7 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/system.h>
22#include <rtems/score/chain.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/object.h>
25#include <rtems/score/states.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/threadq.h>
28#include <rtems/score/tqdata.h>
29
30void _Thread_queue_Process_timeout(
31  Thread_Control *the_thread
32)
33{
34  Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
35
36  /*
37   *  If the_thread_queue is not synchronized, then it is either
38   *  "nothing happened", "timeout", or "satisfied".   If the_thread
39   *  is the executing thread, then it is in the process of blocking
40   *  and it is the thread which is responsible for the synchronization
41   *  process.
42   *
43   *  If it is not satisfied, then it is "nothing happened" and
44   *  this is the "timeout" transition.  After a request is satisfied,
45   *  a timeout is not allowed to occur.
46   */
47
48  if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
49       _Thread_Is_executing( the_thread ) ) {
50    if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
51      the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
52      the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
53    }
54  } else {
55    the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
56    _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
57  }
58}
59
Note: See TracBrowser for help on using the repository browser.