Changeset 2d2352b in rtems


Ignore:
Timestamp:
Jun 5, 2013, 9:48:57 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7cf2ec6f
Parents:
54e9216
git-author:
Sebastian Huber <sebastian.huber@…> (06/05/13 09:48:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/07/13 15:06:43)
Message:

score: Add and use _Objects_Put()

Add and use _Objects_Put_without_thread_dispatch(). These two functions
pair with the _Objects_Get() function. This helps to introduce object
specific SMP locks to avoid lock contention.

Location:
cpukit
Files:
114 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/pipe/fifo.c

    r54e9216 r2d2352b  
    7575static void pipe_interruptible(pipe_control_t *pipe)
    7676{
    77   Objects_Locations location;
    78 
    79   _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state
    80     |= STATES_INTERRUPTIBLE_BY_SIGNAL;
    81   _Thread_Enable_dispatch();
    82   _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state
    83     |= STATES_INTERRUPTIBLE_BY_SIGNAL;
    84   _Thread_Enable_dispatch();
     77  Objects_Locations  location;
     78  Barrier_Control   *the_barrier;
     79
     80  the_barrier = _Barrier_Get(pipe->readBarrier, &location);
     81  the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
     82  _Objects_Put( &the_barrier->Object );
     83
     84  the_barrier = _Barrier_Get(pipe->writeBarrier, &location);
     85  the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
     86  _Objects_Put( &the_barrier->Object );
    8587}
    8688#endif
  • cpukit/posix/src/canceleval.c

    r54e9216 r2d2352b  
    3636       thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
    3737       thread_support->cancelation_requested ) {
     38    /* FIXME: This path is broken on SMP */
    3839    _Thread_Unnest_dispatch();
    3940    _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
    4041  } else
    41     _Thread_Enable_dispatch();
     42    _Objects_Put( &the_thread->Object );
    4243
    4344}
  • cpukit/posix/src/conddestroy.c

    r54e9216 r2d2352b  
    4747
    4848      if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
    49         _Thread_Enable_dispatch();
     49        _Objects_Put( &the_cond->Object );
    5050        return EBUSY;
    5151      }
     
    5757
    5858      _POSIX_Condition_variables_Free( the_cond );
    59       _Thread_Enable_dispatch();
     59      _Objects_Put( &the_cond->Object );
    6060      return 0;
    6161
  • cpukit/posix/src/condsignalsupp.c

    r54e9216 r2d2352b  
    5656      } while ( is_broadcast && the_thread );
    5757
    58       _Thread_Enable_dispatch();
     58      _Objects_Put( &the_cond->Object );
    5959
    6060      return 0;
  • cpukit/posix/src/condwaitsupp.c

    r54e9216 r2d2352b  
    3838{
    3939  register POSIX_Condition_variables_Control *the_cond;
     40  POSIX_Mutex_Control                        *the_mutex;
    4041  Objects_Locations                           location;
    4142  int                                         status;
    4243  int                                         mutex_status;
    4344
    44   if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
     45  the_mutex = _POSIX_Mutex_Get( mutex, &location );
     46  if ( !the_mutex ) {
    4547     return EINVAL;
    4648  }
    4749
    48   _Thread_Unnest_dispatch();
     50  _Objects_Put_without_thread_dispatch( &the_mutex->Object );
    4951
    5052  the_cond = _POSIX_Condition_variables_Get( cond, &location );
     
    5456
    5557      if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
    56         _Thread_Enable_dispatch();
     58        _Objects_Put( &the_cond->Object );
    5759        return EINVAL;
    5860      }
     
    6163/* XXX ignore this for now  since behavior is undefined
    6264      if ( mutex_status ) {
    63         _Thread_Enable_dispatch();
     65        _Objects_Put( &the_cond->Object );
    6466        return EINVAL;
    6567      }
     
    7678        _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
    7779
    78         _Thread_Enable_dispatch();
     80        _Objects_Put( &the_cond->Object );
    7981
    8082        /*
     
    9597
    9698      } else {
    97         _Thread_Enable_dispatch();
     99        _Objects_Put( &the_cond->Object );
    98100        status = ETIMEDOUT;
    99101      }
  • cpukit/posix/src/keydelete.c

    r54e9216 r2d2352b  
    5252       */
    5353      _POSIX_Keys_Free( the_key );
    54       _Thread_Enable_dispatch();
     54      _Objects_Put( &the_key->Object );
    5555      return 0;
    5656
  • cpukit/posix/src/keygetspecific.c

    r54e9216 r2d2352b  
    5050      index    = _Objects_Get_index( _Thread_Executing->Object.id );
    5151      key_data = (void *) the_key->Values[ api ][ index ];
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_key->Object );
    5353      return key_data;
    5454
  • cpukit/posix/src/keysetspecific.c

    r54e9216 r2d2352b  
    5050      index = _Objects_Get_index( _Thread_Executing->Object.id );
    5151      the_key->Values[ api ][ index ] = (void *) value;
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_key->Object );
    5353      return 0;
    5454
  • cpukit/posix/src/mqueueclose.c

    r54e9216 r2d2352b  
    7979      _POSIX_Message_queue_Free_fd( the_mq_fd );
    8080
    81       _Thread_Enable_dispatch();
     81      _Objects_Put( &the_mq_fd->Object );
    8282      return 0;
    8383   }
  • cpukit/posix/src/mqueuegetattr.c

    r54e9216 r2d2352b  
    7575      mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
    7676
    77       _Thread_Enable_dispatch();
     77      _Objects_Put( &the_mq_fd->Object );
    7878      return 0;
    7979
  • cpukit/posix/src/mqueuenotify.c

    r54e9216 r2d2352b  
    7070      if ( notification ) {
    7171        if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) {
    72           _Thread_Enable_dispatch();
     72          _Objects_Put( &the_mq_fd->Object );
    7373          rtems_set_errno_and_return_minus_one( EBUSY );
    7474        }
     
    8989      }
    9090
    91       _Thread_Enable_dispatch();
     91      _Objects_Put( &the_mq_fd->Object );
    9292      return 0;
    9393
  • cpukit/posix/src/mqueuerecvsupp.c

    r54e9216 r2d2352b  
    6060    case OBJECTS_LOCAL:
    6161      if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
    62         _Thread_Enable_dispatch();
     62        _Objects_Put( &the_mq_fd->Object );
    6363        rtems_set_errno_and_return_minus_one( EBADF );
    6464      }
     
    6767
    6868      if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
    69         _Thread_Enable_dispatch();
     69        _Objects_Put( &the_mq_fd->Object );
    7070        rtems_set_errno_and_return_minus_one( EMSGSIZE );
    7171      }
     
    9898      );
    9999
    100       _Thread_Enable_dispatch();
     100      _Objects_Put( &the_mq_fd->Object );
    101101      if (msg_prio) {
    102102        *msg_prio = _POSIX_Message_queue_Priority_from_core(
  • cpukit/posix/src/mqueuesendsupp.c

    r54e9216 r2d2352b  
    7878    case OBJECTS_LOCAL:
    7979      if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) {
    80         _Thread_Enable_dispatch();
     80        _Objects_Put( &the_mq_fd->Object );
    8181        rtems_set_errno_and_return_minus_one( EBADF );
    8282      }
     
    106106      );
    107107
    108       _Thread_Enable_dispatch();
     108      _Objects_Put( &the_mq_fd->Object );
    109109
    110110      /*
  • cpukit/posix/src/mqueuesetattr.c

    r54e9216 r2d2352b  
    6565
    6666      the_mq_fd->oflag = mqstat->mq_flags;
    67       _Thread_Enable_dispatch();
     67      _Objects_Put( &the_mq_fd->Object );
    6868      return 0;
    6969
  • cpukit/posix/src/mutexdestroy.c

    r54e9216 r2d2352b  
    5050
    5151      if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) {
    52         _Thread_Enable_dispatch();
     52        _Objects_Put( &the_mutex->Object );
    5353        return EBUSY;
    5454      }
     
    5959
    6060      _POSIX_Mutex_Free( the_mutex );
    61       _Thread_Enable_dispatch();
     61      _Objects_Put( &the_mutex->Object );
    6262      return 0;
    6363
  • cpukit/posix/src/mutexgetprioceiling.c

    r54e9216 r2d2352b  
    5454        the_mutex->Mutex.Attributes.priority_ceiling
    5555      );
    56       _Thread_Enable_dispatch();
     56      _Objects_Put( &the_mutex->Object );
    5757      return 0;
    5858
  • cpukit/posix/src/mutexinit.c

    r54e9216 r2d2352b  
    8686      switch ( location ) {
    8787        case OBJECTS_LOCAL:
    88           _Thread_Enable_dispatch();
     88          _Objects_Put( &mutex_in_use->Object );
    8989          return EBUSY;
    9090        #if defined(RTEMS_MULTIPROCESSING)
  • cpukit/posix/src/mutexsetprioceiling.c

    r54e9216 r2d2352b  
    8181        NULL
    8282      );
    83       _Thread_Enable_dispatch();
     83      _Objects_Put( &the_mutex->Object );
    8484
    8585      return 0;
  • cpukit/posix/src/mutexunlock.c

    r54e9216 r2d2352b  
    5555        NULL
    5656      );
    57       _Thread_Enable_dispatch();
     57      _Objects_Put( &the_mutex->Object );
    5858      return _POSIX_Mutex_Translate_core_mutex_return_code( status );
    5959
  • cpukit/posix/src/pbarrierdestroy.c

    r54e9216 r2d2352b  
    5151    case OBJECTS_LOCAL:
    5252      if ( the_barrier->Barrier.number_of_waiting_threads != 0 ) {
    53         _Thread_Enable_dispatch();
     53        _Objects_Put( &the_barrier->Object );
    5454        return EBUSY;
    5555      }
     
    5959      _POSIX_Barrier_Free( the_barrier );
    6060
    61       _Thread_Enable_dispatch();
     61      _Objects_Put( &the_barrier->Object );
    6262      return 0;
    6363
  • cpukit/posix/src/pbarrierwait.c

    r54e9216 r2d2352b  
    5656        NULL
    5757      );
    58       _Thread_Enable_dispatch();
     58      _Objects_Put( &the_barrier->Object );
    5959      return _POSIX_Barrier_Translate_core_barrier_return_code(
    6060                _Thread_Executing->Wait.return_code );
  • cpukit/posix/src/prwlockdestroy.c

    r54e9216 r2d2352b  
    5353       */
    5454      if ( _Thread_queue_First( &the_rwlock->RWLock.Wait_queue ) != NULL ) {
    55         _Thread_Enable_dispatch();
     55        _Objects_Put( &the_rwlock->Object );
    5656        return EBUSY;
    5757      }
     
    6565      _POSIX_RWLock_Free( the_rwlock );
    6666
    67       _Thread_Enable_dispatch();
     67      _Objects_Put( &the_rwlock->Object );
    6868      return 0;
    6969
  • cpukit/posix/src/prwlockrdlock.c

    r54e9216 r2d2352b  
    5757      );
    5858
    59       _Thread_Enable_dispatch();
     59      _Objects_Put( &the_rwlock->Object );
    6060      return _POSIX_RWLock_Translate_core_RWLock_return_code(
    6161        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
  • cpukit/posix/src/prwlocktimedrdlock.c

    r54e9216 r2d2352b  
    8383      );
    8484
    85       _Thread_Enable_dispatch();
     85      _Objects_Put( &the_rwlock->Object );
    8686      if ( !do_wait ) {
    8787        if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
  • cpukit/posix/src/prwlocktimedwrlock.c

    r54e9216 r2d2352b  
    8585      );
    8686
    87       _Thread_Enable_dispatch();
     87      _Objects_Put( &the_rwlock->Object );
    8888      if ( !do_wait &&
    8989           (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
  • cpukit/posix/src/prwlocktryrdlock.c

    r54e9216 r2d2352b  
    6262
    6363
    64       _Thread_Enable_dispatch();
     64      _Objects_Put( &the_rwlock->Object );
    6565      return _POSIX_RWLock_Translate_core_RWLock_return_code(
    6666        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
  • cpukit/posix/src/prwlocktrywrlock.c

    r54e9216 r2d2352b  
    6161      );
    6262
    63       _Thread_Enable_dispatch();
     63      _Objects_Put( &the_rwlock->Object );
    6464      return _POSIX_RWLock_Translate_core_RWLock_return_code(
    6565        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
  • cpukit/posix/src/prwlockunlock.c

    r54e9216 r2d2352b  
    5656    case OBJECTS_LOCAL:
    5757      status = _CORE_RWLock_Release( &the_rwlock->RWLock );
    58       _Thread_Enable_dispatch();
     58      _Objects_Put( &the_rwlock->Object );
    5959      return _POSIX_RWLock_Translate_core_RWLock_return_code( status );
    6060
  • cpukit/posix/src/prwlockwrlock.c

    r54e9216 r2d2352b  
    6363      );
    6464
    65       _Thread_Enable_dispatch();
     65      _Objects_Put( &the_rwlock->Object );
    6666      return _POSIX_RWLock_Translate_core_RWLock_return_code(
    6767        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
  • cpukit/posix/src/pspindestroy.c

    r54e9216 r2d2352b  
    5151    case OBJECTS_LOCAL:
    5252      if ( _CORE_spinlock_Is_busy( &the_spinlock->Spinlock ) ) {
    53         _Thread_Enable_dispatch();
     53        _Objects_Put( &the_spinlock->Object );
    5454        return EBUSY;
    5555      }
     
    5959      _POSIX_Spinlock_Free( the_spinlock );
    6060
    61       _Thread_Enable_dispatch();
     61      _Objects_Put( &the_spinlock->Object );
    6262      return 0;
    6363
  • cpukit/posix/src/pspinlock.c

    r54e9216 r2d2352b  
    5050    case OBJECTS_LOCAL:
    5151      status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, true, 0 );
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_spinlock->Object );
    5353      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
    5454
  • cpukit/posix/src/pspintrylock.c

    r54e9216 r2d2352b  
    5454    case OBJECTS_LOCAL:
    5555      status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, false, 0 );
    56       _Thread_Enable_dispatch();
     56      _Objects_Put( &the_spinlock->Object );
    5757      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
    5858
  • cpukit/posix/src/pspinunlock.c

    r54e9216 r2d2352b  
    5656    case OBJECTS_LOCAL:
    5757      status = _CORE_spinlock_Release( &the_spinlock->Spinlock );
    58       _Thread_Enable_dispatch();
     58      _Objects_Put( &the_spinlock->Object );
    5959      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
    6060
  • cpukit/posix/src/pthreaddetach.c

    r54e9216 r2d2352b  
    4444      api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    4545      api->detachstate = PTHREAD_CREATE_DETACHED;
    46       _Thread_Enable_dispatch();
     46      _Objects_Put( &the_thread->Object );
    4747      return 0;
    4848
  • cpukit/posix/src/pthreadequal.c

    r54e9216 r2d2352b  
    4242  return _Objects_Are_ids_equal( t1, t2 );
    4343#else
    44   int               status;
    45   Objects_Locations location;
     44  int                status;
     45  Objects_Locations  location;
     46  Thread_Control    *thread_1;
     47  Thread_Control    *thread_2;
    4648
    4749  /*
     
    5557   */
    5658
    57   (void) _Thread_Get( t1, &location );
     59  thread_1 = _Thread_Get( t1, &location );
    5860  switch ( location ) {
    5961
     
    6466       */
    6567
    66       (void) _Thread_Get( t2, &location );
     68      thread_2 = _Thread_Get( t2, &location );
    6769      switch ( location ) {
    6870
    6971        case OBJECTS_LOCAL:
    7072          status = _Objects_Are_ids_equal( t1, t2 );
    71           _Thread_Unnest_dispatch();
    72           _Thread_Enable_dispatch();
    73           break;
     73          _Objects_Put_without_thread_dispatch( &thread_2->Object );
     74          _Objects_Put( &thread_1->Object );
     75          break;
    7476
    7577        case OBJECTS_ERROR:
     
    7880#endif
    7981          /* t1 must have been valid so exit the critical section */
    80           _Thread_Enable_dispatch();
     82          _Objects_Put( &thread_1->Object );
    8183          /* return status == 0 */
    8284          break;
  • cpukit/posix/src/pthreadexit.c

    r54e9216 r2d2352b  
    7373            STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_TRANSIENT
    7474          );
     75           /* FIXME: Lock order reversal */
    7576           _RTEMS_Unlock_allocator();
    7677          _Thread_Enable_dispatch();
     
    8889      _POSIX_Threads_Free( the_thread );
    8990
     91     /* FIXME: Lock order reversal */
    9092    _RTEMS_Unlock_allocator();
    9193  _Thread_Enable_dispatch();
  • cpukit/posix/src/pthreadgetschedparam.c

    r54e9216 r2d2352b  
    5454          _POSIX_Priority_From_core( the_thread->current_priority );
    5555      }
    56       _Thread_Enable_dispatch();
     56      _Objects_Put( &the_thread->Object );
    5757      return 0;
    5858
  • cpukit/posix/src/pthreadjoin.c

    r54e9216 r2d2352b  
    4646
    4747      if ( api->detachstate == PTHREAD_CREATE_DETACHED ) {
    48         _Thread_Enable_dispatch();
     48        _Objects_Put( &the_thread->Object );
    4949        return EINVAL;
    5050      }
    5151
    5252      if ( _Thread_Is_executing( the_thread ) ) {
    53         _Thread_Enable_dispatch();
     53        _Objects_Put( &the_thread->Object );
    5454        return EDEADLK;
    5555      }
     
    7171        _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
    7272      }
    73       _Thread_Enable_dispatch();
     73      _Objects_Put( &the_thread->Object );
    7474
    7575      if ( _Thread_Executing->Wait.return_code == EINTR )
  • cpukit/posix/src/pthreadkill.c

    r54e9216 r2d2352b  
    6161
    6262        if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
    63           _Thread_Enable_dispatch();
     63          _Objects_Put( &the_thread->Object );
    6464          return 0;
    6565        }
     
    7272
    7373        if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
    74           _Thread_Dispatch_necessary = true;
     74          _Thread_Dispatch_necessary = true;
    7575      }
    76       _Thread_Enable_dispatch();
     76      _Objects_Put( &the_thread->Object );
    7777      return 0;
    7878
  • cpukit/posix/src/pthreadsetschedparam.c

    r54e9216 r2d2352b  
    9999      }
    100100
    101       _Thread_Enable_dispatch();
     101      _Objects_Put( &the_thread->Object );
    102102      return 0;
    103103
  • cpukit/posix/src/semaphorewaitsupp.c

    r54e9216 r2d2352b  
    5252        timeout
    5353      );
    54       _Thread_Enable_dispatch();
     54      _Objects_Put( &the_semaphore->Object );
    5555
    5656      if ( !_Thread_Executing->Wait.return_code )
  • cpukit/posix/src/semclose.c

    r54e9216 r2d2352b  
    4646      the_semaphore->open_count -= 1;
    4747      _POSIX_Semaphore_Delete( the_semaphore );
    48       _Thread_Enable_dispatch();
     48      _Objects_Put( &the_semaphore->Object );
    4949      return 0;
    5050
  • cpukit/posix/src/semdestroy.c

    r54e9216 r2d2352b  
    4949
    5050      if ( the_semaphore->named == true ) {
    51         _Thread_Enable_dispatch();
     51        _Objects_Put( &the_semaphore->Object );
    5252        rtems_set_errno_and_return_minus_one( EINVAL );
    5353      }
    5454
    5555      _POSIX_Semaphore_Delete( the_semaphore );
    56       _Thread_Enable_dispatch();
     56      _Objects_Put( &the_semaphore->Object );
    5757      return 0;
    5858
  • cpukit/posix/src/semgetvalue.c

    r54e9216 r2d2352b  
    4646    case OBJECTS_LOCAL:
    4747      *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore );
    48       _Thread_Enable_dispatch();
     48      _Objects_Put( &the_semaphore->Object );
    4949      return 0;
    5050
  • cpukit/posix/src/sempost.c

    r54e9216 r2d2352b  
    5353#endif
    5454      );
    55       _Thread_Enable_dispatch();
     55      _Objects_Put( &the_semaphore->Object );
    5656      return 0;
    5757
  • cpukit/posix/src/timercreate.c

    r54e9216 r2d2352b  
    7373  ptimer = _POSIX_Timer_Allocate();
    7474  if ( !ptimer ) {
    75     _Thread_Enable_dispatch();
     75    _Objects_Put( &ptimer->Object );
    7676    rtems_set_errno_and_return_minus_one( EAGAIN );
    7777  }
     
    9898
    9999  *timerid  = ptimer->Object.id;
    100   _Thread_Enable_dispatch();
     100  _Objects_Put( &ptimer->Object );
    101101  return 0;
    102102}
  • cpukit/posix/src/timerdelete.c

    r54e9216 r2d2352b  
    5555      (void) _Watchdog_Remove( &ptimer->Timer );
    5656      _POSIX_Timer_Free( ptimer );
    57       _Thread_Enable_dispatch();
     57      _Objects_Put( &ptimer->Object );
    5858      return 0;
    5959
  • cpukit/posix/src/timergetoverrun.c

    r54e9216 r2d2352b  
    4141      overrun = ptimer->overrun;
    4242      ptimer->overrun = 0;
    43       _Thread_Enable_dispatch();
     43      _Objects_Put( &ptimer->Object );
    4444      return overrun;
    4545
  • cpukit/posix/src/timergettime.c

    r54e9216 r2d2352b  
    6969      value->it_interval  = ptimer->timer_data.it_interval;
    7070
    71       _Thread_Enable_dispatch();
     71      _Objects_Put( &ptimer->Object );
    7272      return 0;
    7373
  • cpukit/posix/src/timersettime.c

    r54e9216 r2d2352b  
    9696         ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
    9797         /* Returns with success */
    98         _Thread_Enable_dispatch();
     98        _Objects_Put( &ptimer->Object );
    9999        return 0;
    100100       }
     
    113113       );
    114114       if ( !activated ) {
    115          _Thread_Enable_dispatch();
     115         _Objects_Put( &ptimer->Object );
    116116         return 0;
    117117       }
     
    128128       ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
    129129       _TOD_Get( &ptimer->time );
    130        _Thread_Enable_dispatch();
     130      _Objects_Put( &ptimer->Object );
    131131       return 0;
    132132
  • cpukit/rtems/src/barrierdelete.c

    r54e9216 r2d2352b  
    4848      _Barrier_Free( the_barrier );
    4949
    50       _Thread_Enable_dispatch();
     50      _Objects_Put( &the_barrier->Object );
    5151      return RTEMS_SUCCESSFUL;
    5252
  • cpukit/rtems/src/barrierrelease.c

    r54e9216 r2d2352b  
    5757    case OBJECTS_LOCAL:
    5858      *released = _CORE_barrier_Release( &the_barrier->Barrier, id, NULL );
    59       _Thread_Enable_dispatch();
     59      _Objects_Put( &the_barrier->Object );
    6060      return RTEMS_SUCCESSFUL;
    6161
  • cpukit/rtems/src/barrierwait.c

    r54e9216 r2d2352b  
    4545        NULL
    4646      );
    47       _Thread_Enable_dispatch();
     47      _Objects_Put( &the_barrier->Object );
    4848      return _Barrier_Translate_core_barrier_return_code(
    4949                _Thread_Executing->Wait.return_code );
  • cpukit/rtems/src/dpmemdelete.c

    r54e9216 r2d2352b  
    4141      _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
    4242      _Dual_ported_memory_Free( the_port );
    43       _Thread_Enable_dispatch();
     43      _Objects_Put( &the_port->Object );
    4444      return RTEMS_SUCCESSFUL;
    4545
  • cpukit/rtems/src/dpmemexternal2internal.c

    r54e9216 r2d2352b  
    5050        *internal = _Addresses_Add_offset( the_port->internal_base,
    5151                                           ending );
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_port->Object );
    5353      return RTEMS_SUCCESSFUL;
    5454
  • cpukit/rtems/src/dpmeminternal2external.c

    r54e9216 r2d2352b  
    5151        *external = _Addresses_Add_offset( the_port->external_base,
    5252                                           ending );
    53       _Thread_Enable_dispatch();
     53      _Objects_Put( &the_port->Object );
    5454      return RTEMS_SUCCESSFUL;
    5555
  • cpukit/rtems/src/eventsend.c

    r54e9216 r2d2352b  
    4343        STATES_WAITING_FOR_EVENT
    4444      );
    45       _Thread_Enable_dispatch();
     45      _Objects_Put( &thread->Object );
    4646      sc = RTEMS_SUCCESSFUL;
    4747      break;
  • cpukit/rtems/src/eventtimeout.c

    r54e9216 r2d2352b  
    5959        if ( !the_thread->Wait.count ) {
    6060          _ISR_Enable( level );
    61           _Thread_Unnest_dispatch();
     61          _Objects_Put_without_thread_dispatch( &the_thread->Object );
    6262          return;
    6363        }
     
    7272      _ISR_Enable( level );
    7373      _Thread_Unblock( the_thread );
    74       _Thread_Unnest_dispatch();
     74      _Objects_Put_without_thread_dispatch( &the_thread->Object );
    7575      break;
    7676
  • cpukit/rtems/src/msgqbroadcast.c

    r54e9216 r2d2352b  
    7171                    );
    7272
    73       _Thread_Enable_dispatch();
     73      _Objects_Put( &the_message_queue->Object );
    7474      return
    7575        _Message_queue_Translate_core_message_queue_return_code( core_status );
  • cpukit/rtems/src/msgqdelete.c

    r54e9216 r2d2352b  
    7878      }
    7979#endif
    80       _Thread_Enable_dispatch();
     80      _Objects_Put( &the_message_queue->Object );
    8181      return RTEMS_SUCCESSFUL;
    8282
  • cpukit/rtems/src/msgqflush.c

    r54e9216 r2d2352b  
    7070    case OBJECTS_LOCAL:
    7171      *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
    72       _Thread_Enable_dispatch();
     72      _Objects_Put( &the_message_queue->Object );
    7373      return RTEMS_SUCCESSFUL;
    7474
  • cpukit/rtems/src/msgqgetnumberpending.c

    r54e9216 r2d2352b  
    6868    case OBJECTS_LOCAL:
    6969      *count = the_message_queue->message_queue.number_of_pending_messages;
    70       _Thread_Enable_dispatch();
     70      _Objects_Put( &the_message_queue->Object );
    7171      return RTEMS_SUCCESSFUL;
    7272
  • cpukit/rtems/src/msgqreceive.c

    r54e9216 r2d2352b  
    7272        timeout
    7373      );
    74       _Thread_Enable_dispatch();
     74      _Objects_Put( &the_message_queue->Object );
    7575      return _Message_queue_Translate_core_message_queue_return_code(
    7676        _Thread_Executing->Wait.return_code
  • cpukit/rtems/src/msgqsend.c

    r54e9216 r2d2352b  
    8787      );
    8888
    89       _Thread_Enable_dispatch();
     89      _Objects_Put( &the_message_queue->Object );
    9090
    9191      /*
  • cpukit/rtems/src/msgqurgent.c

    r54e9216 r2d2352b  
    6969        0        /* no timeout */
    7070      );
    71       _Thread_Enable_dispatch();
     71      _Objects_Put( &the_message_queue->Object );
    7272
    7373      /*
  • cpukit/rtems/src/partdelete.c

    r54e9216 r2d2352b  
    5959#endif
    6060
    61         _Thread_Enable_dispatch();
     61        _Objects_Put( &the_partition->Object );
    6262        return RTEMS_SUCCESSFUL;
    6363      }
    64       _Thread_Enable_dispatch();
     64      _Objects_Put( &the_partition->Object );
    6565      return RTEMS_RESOURCE_IN_USE;
    6666
  • cpukit/rtems/src/partgetbuffer.c

    r54e9216 r2d2352b  
    4747      if ( the_buffer ) {
    4848        the_partition->number_of_used_blocks += 1;
    49         _Thread_Enable_dispatch();
     49        _Objects_Put( &the_partition->Object );
    5050        *buffer = the_buffer;
    5151        return RTEMS_SUCCESSFUL;
    5252      }
    53       _Thread_Enable_dispatch();
     53      _Objects_Put( &the_partition->Object );
    5454      return RTEMS_UNSATISFIED;
    5555
  • cpukit/rtems/src/partreturnbuffer.c

    r54e9216 r2d2352b  
    5454        _Partition_Free_buffer( the_partition, buffer );
    5555        the_partition->number_of_used_blocks -= 1;
    56         _Thread_Enable_dispatch();
     56        _Objects_Put( &the_partition->Object );
    5757        return RTEMS_SUCCESSFUL;
    5858      }
    59       _Thread_Enable_dispatch();
     59      _Objects_Put( &the_partition->Object );
    6060      return RTEMS_INVALID_ADDRESS;
    6161
  • cpukit/rtems/src/ratemoncancel.c

    r54e9216 r2d2352b  
    3939    case OBJECTS_LOCAL:
    4040      if ( !_Thread_Is_executing( the_period->owner ) ) {
    41         _Thread_Enable_dispatch();
     41        _Objects_Put( &the_period->Object );
    4242        return RTEMS_NOT_OWNER_OF_RESOURCE;
    4343      }
     
    4545      the_period->state = RATE_MONOTONIC_INACTIVE;
    4646      _Scheduler_Release_job(the_period->owner, 0);
    47       _Thread_Enable_dispatch();
     47      _Objects_Put( &the_period->Object );
    4848      return RTEMS_SUCCESSFUL;
    4949
  • cpukit/rtems/src/ratemondelete.c

    r54e9216 r2d2352b  
    4343      the_period->state = RATE_MONOTONIC_INACTIVE;
    4444      _Rate_monotonic_Free( the_period );
    45       _Thread_Enable_dispatch();
     45      _Objects_Put( &the_period->Object );
    4646      return RTEMS_SUCCESSFUL;
    4747
  • cpukit/rtems/src/ratemongetstatistics.c

    r54e9216 r2d2352b  
    6464      #endif
    6565
    66       _Thread_Enable_dispatch();
     66      _Objects_Put( &the_period->Object );
    6767      return RTEMS_SUCCESSFUL;
    6868
  • cpukit/rtems/src/ratemongetstatus.c

    r54e9216 r2d2352b  
    7474          );
    7575        if (!valid_status) {
    76           _Thread_Enable_dispatch();
     76          _Objects_Put( &the_period->Object );
    7777          return RTEMS_NOT_DEFINED;
    7878        }
     
    9191      }
    9292
    93       _Thread_Enable_dispatch();
     93      _Objects_Put( &the_period->Object );
    9494      return RTEMS_SUCCESSFUL;
    9595
  • cpukit/rtems/src/ratemonperiod.c

    r54e9216 r2d2352b  
    246246    case OBJECTS_LOCAL:
    247247      if ( !_Thread_Is_executing( the_period->owner ) ) {
    248         _Thread_Enable_dispatch();
     248        _Objects_Put( &the_period->Object );
    249249        return RTEMS_NOT_OWNER_OF_RESOURCE;
    250250      }
     
    264264            break;
    265265        }
    266         _Thread_Enable_dispatch();
     266        _Objects_Put( &the_period->Object );
    267267        return( return_value );
    268268      }
     
    288288
    289289        _Watchdog_Insert_ticks( &the_period->Timer, length );
    290         _Thread_Enable_dispatch();
     290        _Objects_Put( &the_period->Object );
    291291        return RTEMS_SUCCESSFUL;
    292292      }
     
    327327          _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
    328328
    329         _Thread_Enable_dispatch();
     329        _Objects_Put( &the_period->Object );
    330330        return RTEMS_SUCCESSFUL;
    331331      }
     
    344344        _Watchdog_Insert_ticks( &the_period->Timer, length );
    345345        _Scheduler_Release_job(the_period->owner, the_period->next_length);
    346         _Thread_Enable_dispatch();
     346        _Objects_Put( &the_period->Object );
    347347        return RTEMS_TIMEOUT;
    348348      }
  • cpukit/rtems/src/ratemonresetstatistics.c

    r54e9216 r2d2352b  
    5454    case OBJECTS_LOCAL:
    5555      _Rate_monotonic_Reset_statistics( the_period );
    56       _Thread_Enable_dispatch();
     56      _Objects_Put( &the_period->Object );
    5757      return RTEMS_SUCCESSFUL;
    5858
  • cpukit/rtems/src/ratemontimeout.c

    r54e9216 r2d2352b  
    6060      } else
    6161        the_period->state = RATE_MONOTONIC_EXPIRED;
    62       _Thread_Unnest_dispatch();
     62      _Objects_Put_without_thread_dispatch( &the_period->Object );
    6363      break;
    6464
  • cpukit/rtems/src/regiongetsegment.c

    r54e9216 r2d2352b  
    8080             *  because this thread is going to block.
    8181             */
     82            /* FIXME: Lock order reversal */
    8283            _Thread_Disable_dispatch();
    8384            _RTEMS_Unlock_allocator();
     
    9293            _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
    9394
    94             _Thread_Enable_dispatch();
     95            _Objects_Put( &the_region->Object );
    9596
    9697            return (rtems_status_code) executing->Wait.return_code;
  • cpukit/rtems/src/rtemsobjectsetname.c

    r54e9216 r2d2352b  
    5555    case OBJECTS_LOCAL:
    5656      _Objects_Set_name( information, the_object, name );
    57       _Thread_Enable_dispatch();
     57      _Objects_Put( the_object );
    5858      return RTEMS_SUCCESSFUL;
    5959
  • cpukit/rtems/src/semdelete.c

    r54e9216 r2d2352b  
    6060             !_Attributes_Is_simple_binary_semaphore(
    6161                 the_semaphore->attribute_set ) ) {
    62           _Thread_Enable_dispatch();
     62          _Objects_Put( &the_semaphore->Object );
    6363          return RTEMS_RESOURCE_IN_USE;
    6464        }
     
    9393      }
    9494#endif
    95       _Thread_Enable_dispatch();
     95      _Objects_Put( &the_semaphore->Object );
    9696      return RTEMS_SUCCESSFUL;
    9797
  • cpukit/rtems/src/semflush.c

    r54e9216 r2d2352b  
    6969        );
    7070      }
    71       _Thread_Enable_dispatch();
     71      _Objects_Put( &the_semaphore->Object );
    7272      return RTEMS_SUCCESSFUL;
    7373
  • cpukit/rtems/src/semrelease.c

    r54e9216 r2d2352b  
    9292          MUTEX_MP_SUPPORT
    9393        );
    94         _Thread_Enable_dispatch();
     94        _Objects_Put( &the_semaphore->Object );
    9595        return _Semaphore_Translate_core_mutex_return_code( mutex_status );
    9696      } else {
     
    100100          MUTEX_MP_SUPPORT
    101101        );
    102         _Thread_Enable_dispatch();
     102        _Objects_Put( &the_semaphore->Object );
    103103        return
    104104          _Semaphore_Translate_core_semaphore_return_code( semaphore_status );
  • cpukit/rtems/src/signalsend.c

    r54e9216 r2d2352b  
    5757          _ASR_Post_signals( signal_set, &asr->signals_pending );
    5858        }
    59         _Thread_Enable_dispatch();
     59        _Objects_Put( &the_thread->Object );
    6060        return RTEMS_SUCCESSFUL;
    6161      }
    62       _Thread_Enable_dispatch();
     62      _Objects_Put( &the_thread->Object );
    6363      return RTEMS_NOT_DEFINED;
    6464
  • cpukit/rtems/src/systemeventsend.c

    r54e9216 r2d2352b  
    4949        STATES_WAITING_FOR_SYSTEM_EVENT
    5050      );
    51       _Thread_Enable_dispatch();
     51      _Objects_Put( &thread->Object );
    5252      sc = RTEMS_SUCCESSFUL;
    5353      break;
  • cpukit/rtems/src/taskdelete.c

    r54e9216 r2d2352b  
    5555
    5656      #if defined(RTEMS_DEBUG)
    57         if ( !the_information ) {
    58           _Thread_Enable_dispatch();
    59           return RTEMS_INVALID_ID;
    60           /* This should never happen if _Thread_Get() works right */
    61         }
     57        if ( !the_information ) {
     58          _Objects_Put( &the_thread->Object );
     59          return RTEMS_INVALID_ID;
     60          /* This should never happen if _Thread_Get() works right */
     61        }
    6262      #endif
    6363
     
    7777      _RTEMS_tasks_Free( the_thread );
    7878
     79      /* FIXME: Lock order reversal */
    7980      _RTEMS_Unlock_allocator();
    80       _Thread_Enable_dispatch();
     81      _Objects_Put( &the_thread->Object );
    8182      return RTEMS_SUCCESSFUL;
    8283
  • cpukit/rtems/src/taskgetnote.c

    r54e9216 r2d2352b  
    7676      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    7777      *note = api->Notepads[ notepad ];
    78       _Thread_Enable_dispatch();
     78      _Objects_Put( &the_thread->Object );
    7979      return RTEMS_SUCCESSFUL;
    8080
  • cpukit/rtems/src/taskissuspended.c

    r54e9216 r2d2352b  
    6161    case OBJECTS_LOCAL:
    6262      if ( !_States_Is_suspended( the_thread->current_state ) ) {
    63         _Thread_Enable_dispatch();
     63        _Objects_Put( &the_thread->Object );
    6464        return RTEMS_SUCCESSFUL;
    6565      }
    66       _Thread_Enable_dispatch();
     66      _Objects_Put( &the_thread->Object );
    6767      return RTEMS_ALREADY_SUSPENDED;
    6868
  • cpukit/rtems/src/taskrestart.c

    r54e9216 r2d2352b  
    4747    case OBJECTS_LOCAL:
    4848      if ( _Thread_Restart( the_thread, NULL, argument ) ) {
    49         _Thread_Enable_dispatch();
     49        _Objects_Put( &the_thread->Object );
    5050        return RTEMS_SUCCESSFUL;
    5151      }
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_thread->Object );
    5353      return RTEMS_INCORRECT_STATE;
    5454
  • cpukit/rtems/src/taskresume.c

    r54e9216 r2d2352b  
    4747      if ( _States_Is_suspended( the_thread->current_state ) ) {
    4848        _Thread_Resume( the_thread );
    49         _Thread_Enable_dispatch();
     49        _Objects_Put( &the_thread->Object );
    5050        return RTEMS_SUCCESSFUL;
    5151      }
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_thread->Object );
    5353      return RTEMS_INCORRECT_STATE;
    5454
  • cpukit/rtems/src/tasksetnote.c

    r54e9216 r2d2352b  
    7373      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    7474      api->Notepads[ notepad ] = note;
    75       _Thread_Enable_dispatch();
     75      _Objects_Put( &the_thread->Object );
    7676      return RTEMS_SUCCESSFUL;
    7777
  • cpukit/rtems/src/tasksetpriority.c

    r54e9216 r2d2352b  
    6262          _Thread_Change_priority( the_thread, new_priority, false );
    6363      }
    64       _Thread_Enable_dispatch();
     64      _Objects_Put( &the_thread->Object );
    6565      return RTEMS_SUCCESSFUL;
    6666
  • cpukit/rtems/src/taskstart.c

    r54e9216 r2d2352b  
    6969      if ( _Thread_Start(
    7070             the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
    71         _Thread_Enable_dispatch();
     71        _Objects_Put( &the_thread->Object );
    7272        return RTEMS_SUCCESSFUL;
    7373      }
    74       _Thread_Enable_dispatch();
     74      _Objects_Put( &the_thread->Object );
    7575      return RTEMS_INCORRECT_STATE;
    7676
  • cpukit/rtems/src/tasksuspend.c

    r54e9216 r2d2352b  
    4747      if ( !_States_Is_suspended( the_thread->current_state ) ) {
    4848        _Thread_Suspend( the_thread );
    49         _Thread_Enable_dispatch();
     49        _Objects_Put( &the_thread->Object );
    5050        return RTEMS_SUCCESSFUL;
    5151      }
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_thread->Object );
    5353      return RTEMS_ALREADY_SUSPENDED;
    5454
  • cpukit/rtems/src/taskvariableadd.c

    r54e9216 r2d2352b  
    4747        if (tvp->ptr == ptr) {
    4848          tvp->dtor = dtor;
    49           _Thread_Enable_dispatch();
     49          _Objects_Put( &the_thread->Object );
    5050          return RTEMS_SUCCESSFUL;
    5151        }
     
    5959         _Workspace_Allocate(sizeof(rtems_task_variable_t));
    6060      if (new == NULL) {
    61         _Thread_Enable_dispatch();
     61        _Objects_Put( &the_thread->Object );
    6262        return RTEMS_NO_MEMORY;
    6363      }
     
    6868      new->next = (struct rtems_task_variable_tt *)the_thread->task_variables;
    6969      the_thread->task_variables = new;
    70       _Thread_Enable_dispatch();
     70      _Objects_Put( &the_thread->Object );
    7171      return RTEMS_SUCCESSFUL;
    7272
  • cpukit/rtems/src/taskvariabledelete.c

    r54e9216 r2d2352b  
    5050
    5151          _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp );
    52           _Thread_Enable_dispatch();
     52          _Objects_Put( &the_thread->Object );
    5353          return RTEMS_SUCCESSFUL;
    5454        }
     
    5656        tvp = (rtems_task_variable_t *)tvp->next;
    5757      }
    58       _Thread_Enable_dispatch();
     58      _Objects_Put( &the_thread->Object );
    5959      return RTEMS_INVALID_ADDRESS;
    6060
  • cpukit/rtems/src/taskvariableget.c

    r54e9216 r2d2352b  
    6060           */
    6161          *result = tvp->tval;
    62           _Thread_Enable_dispatch();
     62          _Objects_Put( &the_thread->Object );
    6363          return RTEMS_SUCCESSFUL;
    6464        }
    6565        tvp = (rtems_task_variable_t *)tvp->next;
    6666      }
    67       _Thread_Enable_dispatch();
     67      _Objects_Put( &the_thread->Object );
    6868      return RTEMS_INVALID_ADDRESS;
    6969
  • cpukit/rtems/src/timercancel.c

    r54e9216 r2d2352b  
    5050      if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
    5151        (void) _Watchdog_Remove( &the_timer->Ticker );
    52       _Thread_Enable_dispatch();
     52      _Objects_Put( &the_timer->Object );
    5353      return RTEMS_SUCCESSFUL;
    5454
  • cpukit/rtems/src/timerdelete.c

    r54e9216 r2d2352b  
    4242      (void) _Watchdog_Remove( &the_timer->Ticker );
    4343      _Timer_Free( the_timer );
    44       _Thread_Enable_dispatch();
     44      _Objects_Put( &the_timer->Object );
    4545      return RTEMS_SUCCESSFUL;
    4646
  • cpukit/rtems/src/timerfireafter.c

    r54e9216 r2d2352b  
    6060        if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) {
    6161          _ISR_Enable( level );
    62           _Thread_Enable_dispatch();
     62          _Objects_Put( &the_timer->Object );
    6363          return RTEMS_SUCCESSFUL;
    6464        }
     
    7575
    7676      _Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
    77       _Thread_Enable_dispatch();
     77      _Objects_Put( &the_timer->Object );
    7878      return RTEMS_SUCCESSFUL;
    7979
  • cpukit/rtems/src/timerfirewhen.c

    r54e9216 r2d2352b  
    6363         seconds - _TOD_Seconds_since_epoch()
    6464       );
    65       _Thread_Enable_dispatch();
     65      _Objects_Put( &the_timer->Object );
    6666      return RTEMS_SUCCESSFUL;
    6767
  • cpukit/rtems/src/timergetinfo.c

    r54e9216 r2d2352b  
    4747      the_info->start_time = the_timer->Ticker.start_time;
    4848      the_info->stop_time  = the_timer->Ticker.stop_time;
    49       _Thread_Enable_dispatch();
     49      _Objects_Put( &the_timer->Object );
    5050      return RTEMS_SUCCESSFUL;
    5151
  • cpukit/rtems/src/timerreset.c

    r54e9216 r2d2352b  
    6767        #if defined(RTEMS_DEBUG)
    6868          if ( !timer_server ) {
    69             _Thread_Enable_dispatch();
     69            _Objects_Put( &the_timer->Object );
    7070            return RTEMS_INCORRECT_STATE;
    7171          }
     
    8181        status = RTEMS_NOT_DEFINED;
    8282      }
    83       _Thread_Enable_dispatch();
     83      _Objects_Put( &the_timer->Object );
    8484      return status;
    8585
  • cpukit/rtems/src/timerserverfireafter.c

    r54e9216 r2d2352b  
    6464        if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) {
    6565          _ISR_Enable( level );
    66           _Thread_Enable_dispatch();
     66          _Objects_Put( &the_timer->Object );
    6767          return RTEMS_SUCCESSFUL;
    6868        }
     
    8080      (*timer_server->schedule_operation)( timer_server, the_timer );
    8181
    82       _Thread_Enable_dispatch();
     82      _Objects_Put( &the_timer->Object );
    8383      return RTEMS_SUCCESSFUL;
    8484
  • cpukit/rtems/src/timerserverfirewhen.c

    r54e9216 r2d2352b  
    8484      (*timer_server->schedule_operation)( timer_server, the_timer );
    8585
    86       _Thread_Enable_dispatch();
     86      _Objects_Put( &the_timer->Object );
    8787      return RTEMS_SUCCESSFUL;
    8888
  • cpukit/sapi/src/extensiondelete.c

    r54e9216 r2d2352b  
    3838      _Objects_Close( &_Extension_Information, &the_extension->Object );
    3939      _Extension_Free( the_extension );
    40       _Thread_Enable_dispatch();
     40      _Objects_Put( &the_extension->Object );
    4141      return RTEMS_SUCCESSFUL;
    4242
  • cpukit/score/inline/rtems/score/object.inl

    r54e9216 r2d2352b  
    378378
    379379/**
     380 * @brief Puts back an object obtained with _Objects_Get().
     381 *
     382 * This function decrements the thread dispatch disable level.  The
     383 * _Thread_Dispatch() is called if the level reaches zero.
     384 */
     385RTEMS_INLINE_ROUTINE void _Objects_Put(
     386  Objects_Control *the_object
     387)
     388{
     389  (void) the_object;
     390  _Thread_Enable_dispatch();
     391}
     392
     393/**
     394 * @brief Puts back an object obtained with _Objects_Get().
     395 *
     396 * This function decrements the thread dispatch disable level.  The
     397 * _Thread_Dispatch() is not called if the level reaches zero, thus a thread
     398 * dispatch will not take place immediately on the current processor.
     399 */
     400RTEMS_INLINE_ROUTINE void _Objects_Put_without_thread_dispatch(
     401  Objects_Control *the_object
     402)
     403{
     404  (void) the_object;
     405  _Thread_Unnest_dispatch();
     406}
     407
     408/**
    380409 * @brief Puts back an object obtained with _Objects_Get_isr_disable().
    381410 */
  • cpukit/score/src/corerwlocktimeout.c

    r54e9216 r2d2352b  
    4040    case OBJECTS_LOCAL:
    4141      _Thread_queue_Process_timeout( the_thread );
    42       _Thread_Unnest_dispatch();
     42      _Objects_Put_without_thread_dispatch( &the_thread->Object );
    4343      break;
    4444  }
  • cpukit/score/src/mpci.c

    r54e9216 r2d2352b  
    268268      _Thread_queue_Extract( &_MPCI_Remote_blocked_threads, the_thread );
    269269      the_thread->Wait.return_code = the_packet->return_code;
    270       _Thread_Unnest_dispatch();
     270      _Objects_Put_without_thread_dispatch( &the_thread->Object );
    271271    break;
    272272  }
  • cpukit/score/src/objectgetnameasstring.c

    r54e9216 r2d2352b  
    9696      *d = '\0';
    9797
    98       _Thread_Enable_dispatch();
     98      _Objects_Put( the_object );
    9999      return name;
    100100  }
  • cpukit/score/src/objectidtoname.c

    r54e9216 r2d2352b  
    6464
    6565  *name = the_object->name;
    66   _Thread_Enable_dispatch();
     66  _Objects_Put( the_object );
    6767  return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
    6868}
  • cpukit/score/src/schedulercbsattachthread.c

    r54e9216 r2d2352b  
    3333  Objects_Locations location;
    3434  Thread_Control *the_thread;
    35   Scheduler_CBS_Per_thread *sched_info;
    3635
    3736  if ( server_id >= _Scheduler_CBS_Maximum_servers )
    3837    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
    39 
    40   the_thread = _Thread_Get(task_id, &location);
    41   /* The routine _Thread_Get may disable dispatch and not enable again. */
    42   if ( the_thread )
    43     _Thread_Enable_dispatch();
    44   if ( !the_thread )
    45     return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
    46 
    47   sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
    48 
    49   /* Thread is already attached to a server. */
    50   if ( sched_info->cbs_server )
    51     return SCHEDULER_CBS_ERROR_FULL;
    5238
    5339  /* Server is not valid. */
     
    5945    return SCHEDULER_CBS_ERROR_FULL;
    6046
    61   _Scheduler_CBS_Server_list[server_id]->task_id = task_id;
    62   sched_info->cbs_server = (void *) _Scheduler_CBS_Server_list[server_id];
     47  the_thread = _Thread_Get(task_id, &location);
     48  /* The routine _Thread_Get may disable dispatch and not enable again. */
     49  if ( the_thread ) {
     50    Scheduler_CBS_Per_thread *sched_info;
    6351
    64   the_thread->budget_callout   = _Scheduler_CBS_Budget_callout;
    65   the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
    66   the_thread->is_preemptible   = true;
     52    sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
     53
     54    /* Thread is already attached to a server. */
     55    if ( sched_info->cbs_server ) {
     56      _Objects_Put( &the_thread->Object );
     57      return SCHEDULER_CBS_ERROR_FULL;
     58    }
     59
     60    _Scheduler_CBS_Server_list[server_id]->task_id = task_id;
     61    sched_info->cbs_server = (void *) _Scheduler_CBS_Server_list[server_id];
     62
     63    the_thread->budget_callout   = _Scheduler_CBS_Budget_callout;
     64    the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
     65    the_thread->is_preemptible   = true;
     66
     67    _Objects_Put( &the_thread->Object );
     68  } else {
     69    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
     70  }
    6771
    6872  return SCHEDULER_CBS_OK;
  • cpukit/score/src/schedulercbsdetachthread.c

    r54e9216 r2d2352b  
    3535  Scheduler_CBS_Per_thread *sched_info;
    3636
    37   the_thread = _Thread_Get(task_id, &location);
    38   /* The routine _Thread_Get may disable dispatch and not enable again. */
    39   if ( the_thread ) {
    40     _Thread_Enable_dispatch();
    41   }
    42 
    4337  if ( server_id >= _Scheduler_CBS_Maximum_servers )
    44     return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
    45   if ( !the_thread )
    4638    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
    4739  /* Server is not valid. */
     
    5244    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
    5345
    54   _Scheduler_CBS_Server_list[server_id]->task_id = -1;
    55   sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
    56   sched_info->cbs_server = NULL;
     46  the_thread = _Thread_Get(task_id, &location);
     47  /* The routine _Thread_Get may disable dispatch and not enable again. */
     48  if ( the_thread ) {
     49    _Scheduler_CBS_Server_list[server_id]->task_id = -1;
     50    sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
     51    sched_info->cbs_server = NULL;
    5752
    58   the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
    59   the_thread->budget_callout   = the_thread->Start.budget_callout;
    60   the_thread->is_preemptible   = the_thread->Start.is_preemptible;
     53    the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
     54    the_thread->budget_callout   = the_thread->Start.budget_callout;
     55    the_thread->is_preemptible   = the_thread->Start.is_preemptible;
     56
     57    _Objects_Put( &the_thread->Object );
     58  } else {
     59    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
     60  }
    6161
    6262  return SCHEDULER_CBS_OK;
  • cpukit/score/src/schedulercbsgetexecutiontime.c

    r54e9216 r2d2352b  
    5050  /* The routine _Thread_Get may disable dispatch and not enable again. */
    5151  if ( the_thread ) {
    52     _Thread_Enable_dispatch();
    5352    *exec_time = _Scheduler_CBS_Server_list[server_id]->parameters.budget -
    5453      the_thread->cpu_time_budget;
     54    _Objects_Put( &the_thread->Object );
    5555  }
    5656  else {
  • cpukit/score/src/schedulercbsgetremainingbudget.c

    r54e9216 r2d2352b  
    4848  /* The routine _Thread_Get may disable dispatch and not enable again. */
    4949  if ( the_thread ) {
    50     _Thread_Enable_dispatch();
    5150    *remaining_budget = the_thread->cpu_time_budget;
     51    _Objects_Put( &the_thread->Object );
    5252  }
    5353  else {
  • cpukit/score/src/threaddelayended.c

    r54e9216 r2d2352b  
    5555          | STATES_INTERRUPTIBLE_BY_SIGNAL
    5656      );
    57       _Thread_Unnest_dispatch();
     57      _Objects_Put_without_thread_dispatch( &the_thread->Object );
    5858      break;
    5959  }
  • cpukit/score/src/threadqtimeout.c

    r54e9216 r2d2352b  
    4646    case OBJECTS_LOCAL:
    4747      _Thread_queue_Process_timeout( the_thread );
    48       _Thread_Unnest_dispatch();
     48      _Objects_Put_without_thread_dispatch( &the_thread->Object );
    4949      break;
    5050  }
Note: See TracChangeset for help on using the changeset viewer.