Changeset 6c7caa1a in rtems


Ignore:
Timestamp:
May 28, 2014, 11:37:54 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
3045738
Parents:
3e201139
git-author:
Sebastian Huber <sebastian.huber@…> (05/28/14 11:37:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/03/14 06:15:16)
Message:

score: Add and use _Thread_Owns_resources()

Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthread.c

    r3e201139 r6c7caa1a  
    116116        the_thread->current_priority, new_priority );
    117117  #endif
    118   if ( the_thread->resource_count == 0 ) {
     118  if ( !_Thread_Owns_resources( the_thread ) ) {
    119119    /*
    120120     *  If this would make them less important, then do not change it.
     
    162162        the_thread->current_priority, new_priority );
    163163  #endif
    164   if ( the_thread->resource_count == 0 ) {
     164  if ( !_Thread_Owns_resources( the_thread ) ) {
    165165    /*
    166166     *  Make sure we are actually lowering it. If they have lowered it
  • cpukit/rtems/src/tasksetpriority.c

    r3e201139 r6c7caa1a  
    4949                                      new_priority
    5050                                    );
    51         if ( the_thread->resource_count == 0 ||
     51        if ( !_Thread_Owns_resources( the_thread ) ||
    5252             the_thread->current_priority > new_priority )
    5353          _Thread_Change_priority( the_thread, new_priority, false );
  • cpukit/score/include/rtems/score/threadimpl.h

    r3e201139 r6c7caa1a  
    786786}
    787787
     788/**
     789 * @brief Returns true if the thread owns resources, and false otherwise.
     790 *
     791 * Resources are accounted with the Thread_Control::resource_count resource
     792 * counter.  This counter is used by semaphore objects for example.
     793 *
     794 * @param[in] the_thread The thread.
     795 */
     796RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
     797  const Thread_Control *the_thread
     798)
     799{
     800  bool owns_resources = the_thread->resource_count != 0;
     801
     802  return owns_resources;
     803}
     804
    788805RTEMS_INLINE_ROUTINE void _Thread_Debug_set_real_processor(
    789806  Thread_Control  *the_thread,
  • cpukit/score/src/coremutexsurrender.c

    r3e201139 r6c7caa1a  
    168168     *  mutex (i.e. resource) this task has.
    169169     */
    170     if ( holder->resource_count == 0 &&
     170    if ( !_Thread_Owns_resources( holder ) &&
    171171         holder->real_priority != holder->current_priority ) {
    172172      _Thread_Change_priority( holder, holder->real_priority, true );
  • cpukit/score/src/threadrestart.c

    r3e201139 r6c7caa1a  
    4848  Thread_Zombie_control *zombies = &_Thread_Zombies;
    4949
    50   if ( the_thread->resource_count != 0 ) {
     50  if ( _Thread_Owns_resources( the_thread ) ) {
    5151    _Terminate(
    5252      INTERNAL_ERROR_CORE,
Note: See TracChangeset for help on using the changeset viewer.