Changeset b7cff7fe in rtems


Ignore:
Timestamp:
Apr 26, 2015, 1:22:20 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
08fe84b
Parents:
776a50c
git-author:
Sebastian Huber <sebastian.huber@…> (04/26/15 13:22:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/19/15 10:00:44)
Message:

score: Reduce thread wait states

Merge THREAD_WAIT_STATE_SATISFIED, THREAD_WAIT_STATE_TIMEOUT,
THREAD_WAIT_STATE_INTERRUPT_SATISFIED, and
THREAD_WAIT_STATE_INTERRUPT_TIMEOUT into one state
THREAD_WAIT_STATE_READY_AGAIN. This helps to write generic routines to
block a thread.

Update #2273.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/eventsurrender.c

    r776a50c rb7cff7fe  
    8686      the_thread,
    8787      intend_to_block,
    88       wait_class | THREAD_WAIT_STATE_INTERRUPT_SATISFIED
     88      wait_class | THREAD_WAIT_STATE_READY_AGAIN
    8989    );
    9090    if ( success ) {
     
    9595      _Thread_Wait_flags_set(
    9696        the_thread,
    97         wait_class | THREAD_WAIT_STATE_SATISFIED
     97        wait_class | THREAD_WAIT_STATE_READY_AGAIN
    9898      );
    9999      unblock = true;
  • cpukit/rtems/src/eventtimeout.c

    r776a50c rb7cff7fe  
    4646    the_thread,
    4747    intend_to_block,
    48     wait_class | THREAD_WAIT_STATE_INTERRUPT_TIMEOUT
     48    wait_class | THREAD_WAIT_STATE_READY_AGAIN
    4949  );
    5050
     
    5656    _Thread_Wait_flags_set(
    5757      the_thread,
    58       wait_class | THREAD_WAIT_STATE_TIMEOUT
     58      wait_class | THREAD_WAIT_STATE_READY_AGAIN
    5959    );
    6060    unblock = true;
  • cpukit/score/include/rtems/score/thread.h

    r776a50c rb7cff7fe  
    325325 * The mutually exclusive wait state flags are
    326326 * - @ref THREAD_WAIT_STATE_INTEND_TO_BLOCK,
    327  * - @ref THREAD_WAIT_STATE_BLOCKED,
    328  * - @ref THREAD_WAIT_STATE_SATISFIED,
    329  * - @ref THREAD_WAIT_STATE_TIMEOUT,
    330  * - @ref THREAD_WAIT_STATE_INTERRUPT_SATISFIED, and
    331  * - @ref THREAD_WAIT_STATE_INTERRUPT_TIMEOUT,
     327 * - @ref THREAD_WAIT_STATE_BLOCKED, and
     328 * - @ref THREAD_WAIT_STATE_READY_AGAIN.
    332329 */
    333330typedef unsigned int Thread_Wait_flags;
  • cpukit/score/include/rtems/score/threadimpl.h

    r776a50c rb7cff7fe  
    11391139
    11401140/**
    1141  * @brief Indicates that the thread progress condition is satisfied and it is
    1142  * ready to resume execution.
    1143  */
    1144 #define THREAD_WAIT_STATE_SATISFIED 0x4U
    1145 
    1146 /**
    1147  * @brief Indicates that a timeout occurred and the thread is ready to resume
    1148  * execution.
    1149  */
    1150 #define THREAD_WAIT_STATE_TIMEOUT 0x8U
    1151 
    1152 /**
    1153  * @brief Indicates that the thread progress condition was satisfied during the
    1154  * blocking operation and it is ready to resume execution.
    1155  */
    1156 #define THREAD_WAIT_STATE_INTERRUPT_SATISFIED 0x10U
    1157 
    1158 /**
    1159  * @brief Indicates that a timeout occurred during the blocking operation and
    1160  * the thread is ready to resume execution.
    1161  */
    1162 #define THREAD_WAIT_STATE_INTERRUPT_TIMEOUT 0x20U
     1141 * @brief Indicates that a condition to end the thread wait occurred.
     1142 *
     1143 * This could be a timeout, a signal, an event or a resource availability.
     1144 */
     1145#define THREAD_WAIT_STATE_READY_AGAIN 0x4U
    11631146
    11641147/**
  • testsuites/sptests/spintrcritical10/init.c

    r776a50c rb7cff7fe  
    8989      rtems_test_assert(
    9090        _Thread_Wait_flags_get(thread)
    91           == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_INTERRUPT_SATISFIED)
     91          == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
    9292      );
    9393    }
     
    186186      rtems_test_assert(
    187187        _Thread_Wait_flags_get(thread)
    188           == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_INTERRUPT_SATISFIED)
     188          == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
    189189      );
    190190    }
     
    270270      rtems_test_assert(
    271271        _Thread_Wait_flags_get(thread)
    272           == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_INTERRUPT_TIMEOUT)
     272          == (THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_READY_AGAIN)
    273273      );
    274274    }
Note: See TracChangeset for help on using the changeset viewer.