mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-27 23:10:16 +00:00
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/thread.h, score/src/threadinitialize.c, score/src/threadreset.c, score/src/threadresume.c, score/src/threadsuspend.c: Nesting count on thread suspension is only supported from ITRON API so disable if ITRON is disabled.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* score/include/rtems/score/thread.h, score/src/threadinitialize.c,
|
||||
score/src/threadreset.c, score/src/threadresume.c,
|
||||
score/src/threadsuspend.c: Nesting count on thread suspension is only
|
||||
supported from ITRON API so disable if ITRON is disabled.
|
||||
|
||||
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* score/include/rtems/score/thread.h, score/src/threadhandler.c: Merge
|
||||
|
||||
@@ -347,14 +347,18 @@ struct Thread_Control_struct {
|
||||
MP_packet_Prefix *receive_packet;
|
||||
#endif
|
||||
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||
/**This field is the head of queue of priority inheritance mutex holed by the thread*/
|
||||
/** This field is the head of queue of priority inheritance mutex
|
||||
* held by the thread.
|
||||
*/
|
||||
Chain_Control lock_mutex;
|
||||
#endif
|
||||
/*================= end of common block =================*/
|
||||
/** This field is the number of nested suspend calls. */
|
||||
uint32_t suspend_count;
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
/** This field is true if the thread is offered globally */
|
||||
bool is_global;
|
||||
#endif
|
||||
/** This field is is true if the post task context switch should be
|
||||
* executed for this thread at the next context switch.
|
||||
*/
|
||||
|
||||
@@ -196,7 +196,9 @@ bool _Thread_Initialize(
|
||||
the_thread->current_state = STATES_DORMANT;
|
||||
the_thread->Wait.queue = NULL;
|
||||
the_thread->resource_count = 0;
|
||||
the_thread->suspend_count = 0;
|
||||
#if defined(RTEMS_ITRON_API)
|
||||
the_thread->suspend_count = 0;
|
||||
#endif
|
||||
the_thread->real_priority = priority;
|
||||
the_thread->Start.initial_priority = priority;
|
||||
_Thread_Set_priority( the_thread, priority );
|
||||
|
||||
@@ -47,7 +47,9 @@ void _Thread_Reset(
|
||||
)
|
||||
{
|
||||
the_thread->resource_count = 0;
|
||||
the_thread->suspend_count = 0;
|
||||
#if defined(RTEMS_ITRON_API)
|
||||
the_thread->suspend_count = 0;
|
||||
#endif
|
||||
the_thread->is_preemptible = the_thread->Start.is_preemptible;
|
||||
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
|
||||
the_thread->budget_callout = the_thread->Start.budget_callout;
|
||||
|
||||
@@ -62,15 +62,17 @@ void _Thread_Resume(
|
||||
|
||||
_ISR_Disable( level );
|
||||
|
||||
if ( force == true )
|
||||
the_thread->suspend_count = 0;
|
||||
else
|
||||
the_thread->suspend_count--;
|
||||
#if defined(RTEMS_ITRON_API)
|
||||
if ( force == true )
|
||||
the_thread->suspend_count = 0;
|
||||
else
|
||||
the_thread->suspend_count--;
|
||||
|
||||
if ( the_thread->suspend_count > 0 ) {
|
||||
_ISR_Enable( level );
|
||||
return;
|
||||
}
|
||||
if ( the_thread->suspend_count > 0 ) {
|
||||
_ISR_Enable( level );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
current_state = the_thread->current_state;
|
||||
if ( current_state & STATES_SUSPENDED ) {
|
||||
|
||||
@@ -56,7 +56,9 @@ void _Thread_Suspend(
|
||||
|
||||
ready = the_thread->ready;
|
||||
_ISR_Disable( level );
|
||||
the_thread->suspend_count++;
|
||||
#if defined(RTEMS_ITRON_API)
|
||||
the_thread->suspend_count++;
|
||||
#endif
|
||||
if ( !_States_Is_ready( the_thread->current_state ) ) {
|
||||
the_thread->current_state =
|
||||
_States_Set( STATES_SUSPENDED, the_thread->current_state );
|
||||
|
||||
Reference in New Issue
Block a user