score: Rename _Thread_queue_Enqueue_critical()

Delete unused _Thread_queue_Enqueue() and rename
_Thread_queue_Enqueue_critical() to _Thread_queue_Enqueue().
This commit is contained in:
Sebastian Huber
2016-11-22 10:53:03 +01:00
parent 125f248231
commit a4217c674d
21 changed files with 31 additions and 69 deletions

View File

@@ -121,7 +121,7 @@ int _POSIX_Condition_variables_Wait_support(
&queue_context,
_POSIX_Condition_variables_Enqueue_callout
);
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_cond->Wait_queue.Queue,
POSIX_CONDITION_VARIABLES_TQ_OPERATIONS,
executing,

View File

@@ -62,7 +62,7 @@ static inline int nanosleep_helper(
* Block for the desired amount of time
*/
_Thread_queue_Acquire( &_Nanosleep_Pseudo_queue, &queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&_Nanosleep_Pseudo_queue.Queue,
&_Thread_queue_Operations_FIFO,
_Thread_Executing,

View File

@@ -157,7 +157,7 @@ int sigtimedwait(
executing->Wait.option = *set;
executing->Wait.return_argument = the_info;
_Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&_POSIX_signals_Wait_queue.Queue,
POSIX_SIGNALS_TQ_OPERATIONS,
executing,

View File

@@ -92,7 +92,7 @@ rtems_status_code rtems_region_get_segment(
_Region_Enqueue_callout
);
_Thread_queue_Context_set_relative_timeout( &queue_context, timeout );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_region->Wait_queue.Queue,
the_region->wait_operations,
executing,

View File

@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Seize(
}
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_semaphore->Wait_queue.Queue,
operations,
executing,

View File

@@ -516,7 +516,7 @@ typedef struct {
/****************** end of common block ********************/
/**
* @brief Thread queue callout for _Thread_queue_Enqueue_critical().
* @brief Thread queue callout for _Thread_queue_Enqueue().
*/
Thread_queue_MP_callout thread_queue_callout;

View File

@@ -193,7 +193,7 @@ struct Thread_queue_Context {
Thread_queue_Lock_context Lock_context;
/**
* @brief The enqueue callout for _Thread_queue_Enqueue_critical().
* @brief The enqueue callout for _Thread_queue_Enqueue().
*
* The callout is invoked after the release of the thread queue lock with
* thread dispatching disabled. Afterwards the thread is blocked.
@@ -272,7 +272,7 @@ struct Thread_queue_Context {
/**
* @brief Invoked in case of a detected deadlock.
*
* Must be initialized for _Thread_queue_Enqueue_critical() in case the
* Must be initialized for _Thread_queue_Enqueue() in case the
* thread queue may have an owner, e.g. for mutex objects.
*
* @see _Thread_queue_Context_set_deadlock_callout().

View File

@@ -101,7 +101,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_initialize(
* @param queue_context The thread queue context.
* @param enqueue_callout The enqueue callout.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void
_Thread_queue_Context_set_enqueue_callout(
@@ -117,7 +117,7 @@ _Thread_queue_Context_set_enqueue_callout(
*
* @param queue_context The thread queue context.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void
_Thread_queue_Context_set_do_nothing_enqueue_callout(
@@ -133,7 +133,7 @@ _Thread_queue_Context_set_do_nothing_enqueue_callout(
* @param queue_context The thread queue context.
* @param timeout The new timeout.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void
_Thread_queue_Context_set_no_timeout(
@@ -149,7 +149,7 @@ _Thread_queue_Context_set_no_timeout(
* @param queue_context The thread queue context.
* @param discipline The clock discipline to use for the timeout.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void
_Thread_queue_Context_set_relative_timeout(
@@ -167,7 +167,7 @@ _Thread_queue_Context_set_relative_timeout(
* @param queue_context The thread queue context.
* @param discipline The clock discipline to use for the timeout.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void
_Thread_queue_Context_set_absolute_timeout(
@@ -183,7 +183,7 @@ _Thread_queue_Context_set_absolute_timeout(
* @brief Sets the deadlock callout in the thread queue
* context.
*
* A deadlock callout must be provided for _Thread_queue_Enqueue_critical()
* A deadlock callout must be provided for _Thread_queue_Enqueue()
* operations that operate on thread queues which may have an owner, e.g. mutex
* objects. Available deadlock callouts are _Thread_queue_Deadlock_status()
* and _Thread_queue_Deadlock_fatal().
@@ -191,7 +191,7 @@ _Thread_queue_Context_set_absolute_timeout(
* @param queue_context The thread queue context.
* @param deadlock_callout The deadlock callout.
*
* @see _Thread_queue_Enqueue_critical().
* @see _Thread_queue_Enqueue().
*/
RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_deadlock_callout(
Thread_queue_Context *queue_context,
@@ -555,7 +555,7 @@ Thread_Control *_Thread_queue_Do_dequeue(
* complete. The operation to enqueue the thread on the queue is protected by
* the thread queue lock. This makes it possible to use the thread queue lock
* to protect the state of objects embedding the thread queue and directly
* enter _Thread_queue_Enqueue_critical() in case the thread must block.
* enter _Thread_queue_Enqueue() in case the thread must block.
*
* @code
* #include <rtems/score/threadqimpl.h>
@@ -583,7 +583,7 @@ Thread_Control *_Thread_queue_Do_dequeue(
* _Thread_queue_Release( &mutex->Queue, queue_context );
* } else {
* _Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
* _Thread_queue_Enqueue_critical(
* _Thread_queue_Enqueue(
* &mutex->Queue.Queue,
* MUTEX_TQ_OPERATIONS,
* executing,
@@ -601,7 +601,7 @@ Thread_Control *_Thread_queue_Do_dequeue(
* @param[in] state The new state of the thread.
* @param[in] queue_context The thread queue context of the lock acquire.
*/
void _Thread_queue_Enqueue_critical(
void _Thread_queue_Enqueue(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
Thread_Control *the_thread,
@@ -640,44 +640,6 @@ Status_Control _Thread_queue_Enqueue_sticky(
);
#endif
/**
* @brief Acquires the thread queue lock and calls
* _Thread_queue_Enqueue_critical().
*/
RTEMS_INLINE_ROUTINE void _Thread_queue_Enqueue(
Thread_queue_Control *the_thread_queue,
const Thread_queue_Operations *operations,
Thread_Control *the_thread,
States_Control state,
uint64_t timeout,
Watchdog_Discipline discipline,
uint32_t expected_level
)
{
Thread_queue_Context queue_context;
_Thread_queue_Context_initialize( &queue_context );
_Thread_queue_Acquire( the_thread_queue, &queue_context );
_Thread_queue_Context_set_enqueue_callout(
&queue_context,
_Thread_queue_Enqueue_do_nothing
);
if ( discipline == WATCHDOG_ABSOLUTE ) {
_Thread_queue_Context_set_absolute_timeout( &queue_context, timeout );
} else {
_Thread_queue_Context_set_relative_timeout( &queue_context, timeout );
}
_Thread_queue_Enqueue_critical(
&the_thread_queue->Queue,
operations,
the_thread,
state,
&queue_context
);
}
/**
* @brief Extracts the thread from the thread queue, restores the default wait
* operations and restores the default thread lock.

View File

@@ -113,7 +113,7 @@ static Thread_Control *_Condition_Do_wait(
&context->Base,
_Condition_Enqueue_callout
);
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&condition->Queue.Queue,
CONDITION_TQ_OPERATIONS,
executing,

View File

@@ -45,7 +45,7 @@ Status_Control _CORE_barrier_Seize(
} else {
the_barrier->number_of_waiting_threads = number_of_waiting_threads;
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_barrier->Wait_queue.Queue,
CORE_BARRIER_TQ_OPERATIONS,
executing,

View File

@@ -114,7 +114,7 @@ Status_Control _CORE_message_queue_Seize(
/* Wait.count will be filled in with the message priority */
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_message_queue->Wait_queue.Queue,
the_message_queue->operations,
executing,

View File

@@ -132,7 +132,7 @@ Status_Control _CORE_message_queue_Submit(
executing->Wait.count = submit_type;
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_message_queue->Wait_queue.Queue,
the_message_queue->operations,
executing,

View File

@@ -37,7 +37,7 @@ Status_Control _CORE_mutex_Seize_slow(
queue_context,
_Thread_queue_Deadlock_status
);
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_mutex->Wait_queue.Queue,
operations,
executing,

View File

@@ -79,7 +79,7 @@ Status_Control _CORE_RWLock_Seize_for_reading(
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ;
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_rwlock->Wait_queue.Queue,
CORE_RWLOCK_TQ_OPERATIONS,
executing,

View File

@@ -67,7 +67,7 @@ Status_Control _CORE_RWLock_Seize_for_writing(
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE;
_Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_rwlock->Wait_queue.Queue,
CORE_RWLOCK_TQ_OPERATIONS,
executing,

View File

@@ -95,7 +95,7 @@ int _Futex_Wait( struct _Futex_Control *_futex, int *uaddr, int val )
_Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
_Thread_queue_Context_set_no_timeout( &queue_context );
_Thread_queue_Context_set_ISR_level( &queue_context, level );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&futex->Queue.Queue,
FUTEX_TQ_OPERATIONS,
executing,

View File

@@ -272,7 +272,7 @@ Status_Control _MPCI_Send_request_packet(
(*_MPCI_table->send_packet)( destination, the_packet );
_Thread_queue_Acquire( &_MPCI_Remote_blocked_threads, &queue_context );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&_MPCI_Remote_blocked_threads.Queue,
&_Thread_queue_Operations_FIFO,
executing,

View File

@@ -115,7 +115,7 @@ static void _Mutex_Acquire_slow(
_Thread_queue_Deadlock_fatal
);
_Thread_queue_Context_set_ISR_level( queue_context, level );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&mutex->Queue.Queue,
MUTEX_TQ_OPERATIONS,
executing,

View File

@@ -106,7 +106,7 @@ void _Semaphore_Wait( struct _Semaphore_Control *_sem )
_Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context );
_Thread_queue_Context_set_no_timeout( &queue_context );
_Thread_queue_Context_set_ISR_level( &queue_context, level );
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&sem->Queue.Queue,
SEMAPHORE_TQ_OPERATIONS,
executing,

View File

@@ -410,7 +410,7 @@ static void _Thread_queue_Timeout(
}
}
void _Thread_queue_Enqueue_critical(
void _Thread_queue_Enqueue(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
Thread_Control *the_thread,

View File

@@ -449,7 +449,7 @@ void _Thread_Join(
executing->Wait.return_argument = NULL;
#endif
_Thread_queue_Enqueue_critical(
_Thread_queue_Enqueue(
&the_thread->Join_queue.Queue,
THREAD_JOIN_TQ_OPERATIONS,
executing,