mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2004-02-26 Thomas Rauscher <trauscher@loytec.com.
PR 584/RTEMS * src/eventtimeout.c: Fix critical section window.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2004-02-26 Thomas Rauscher <trauscher@loytec.com.
|
||||||
|
|
||||||
|
PR 584/RTEMS
|
||||||
|
* src/eventtimeout.c: Fix critical section window.
|
||||||
|
|
||||||
2003-10-22 Joel Sherrill <joel@OARcorp.com>
|
2003-10-22 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
PR 512/core
|
PR 512/core
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ void _Event_Timeout(
|
|||||||
void *ignored
|
void *ignored
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Thread_Control *the_thread;
|
Thread_Control *the_thread;
|
||||||
Objects_Locations location;
|
Objects_Locations location;
|
||||||
|
ISR_Level level;
|
||||||
|
|
||||||
the_thread = _Thread_Get( id, &location );
|
the_thread = _Thread_Get( id, &location );
|
||||||
switch ( location ) {
|
switch ( location ) {
|
||||||
@@ -61,14 +62,25 @@ void _Event_Timeout(
|
|||||||
* a timeout is not allowed to occur.
|
* a timeout is not allowed to occur.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
|
_ISR_Disable( level );
|
||||||
_Thread_Is_executing( the_thread ) ) {
|
if ( the_thread->Wait.count ) { /* verify thread is waiting */
|
||||||
if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
|
the_thread->Wait.count = 0;
|
||||||
_Event_Sync_state = EVENT_SYNC_TIMEOUT;
|
if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
|
||||||
} else {
|
_Thread_Is_executing( the_thread ) ) {
|
||||||
the_thread->Wait.return_code = RTEMS_TIMEOUT;
|
if ( _Event_Sync_state != EVENT_SYNC_SATISFIED ) {
|
||||||
_Thread_Unblock( the_thread );
|
_Event_Sync_state = EVENT_SYNC_TIMEOUT;
|
||||||
|
}
|
||||||
|
_ISR_Enable( level );
|
||||||
|
} else {
|
||||||
|
the_thread->Wait.return_code = RTEMS_TIMEOUT;
|
||||||
|
_ISR_Enable( level );
|
||||||
|
_Thread_Unblock( the_thread );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_ISR_Enable( level );
|
||||||
|
}
|
||||||
|
|
||||||
_Thread_Unnest_dispatch();
|
_Thread_Unnest_dispatch();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user