Made _Event_Sync volatile

Replaced critical section algorithm to correct race conditions.
This resulted in the new variable _Event_Sync_state and the type
_Event_Sync_states.
This commit is contained in:
Joel Sherrill
1995-12-01 19:28:52 +00:00
parent eedbfd94e0
commit 7f6fab613a
3 changed files with 45 additions and 6 deletions

View File

@@ -42,6 +42,18 @@ extern "C" {
#define EVENT_CURRENT 0
/*
* The following enumerated types indicate what happened while the event
* manager was in the synchronization window.
*/
typedef enum {
EVENT_SYNC_NOTHING_HAPPENED,
EVENT_SYNC_TIMEOUT,
EVENT_SYNC_SATISFIED
} Event_Sync_states;
/*
* _Event_Manager_initialization
*
@@ -142,12 +154,13 @@ void _Event_Timeout (
);
/*
* The following defines the synchronization flag used by the
* The following defines the synchronization flags used by the
* Event Manager to insure that signals sent to the currently
* executing thread are received properly.
*/
EXTERN boolean _Event_Sync; /* event manager sync flag */
EXTERN volatile boolean _Event_Sync;
EXTERN volatile Event_Sync_states _Event_Sync_state;
#include <rtems/rtems/eventmp.h>
#include <rtems/rtems/event.inl>

View File

@@ -42,6 +42,18 @@ extern "C" {
#define EVENT_CURRENT 0
/*
* The following enumerated types indicate what happened while the event
* manager was in the synchronization window.
*/
typedef enum {
EVENT_SYNC_NOTHING_HAPPENED,
EVENT_SYNC_TIMEOUT,
EVENT_SYNC_SATISFIED
} Event_Sync_states;
/*
* _Event_Manager_initialization
*
@@ -142,12 +154,13 @@ void _Event_Timeout (
);
/*
* The following defines the synchronization flag used by the
* The following defines the synchronization flags used by the
* Event Manager to insure that signals sent to the currently
* executing thread are received properly.
*/
EXTERN boolean _Event_Sync; /* event manager sync flag */
EXTERN volatile boolean _Event_Sync;
EXTERN volatile Event_Sync_states _Event_Sync_state;
#include <rtems/rtems/eventmp.h>
#include <rtems/rtems/event.inl>

View File

@@ -42,6 +42,18 @@ extern "C" {
#define EVENT_CURRENT 0
/*
* The following enumerated types indicate what happened while the event
* manager was in the synchronization window.
*/
typedef enum {
EVENT_SYNC_NOTHING_HAPPENED,
EVENT_SYNC_TIMEOUT,
EVENT_SYNC_SATISFIED
} Event_Sync_states;
/*
* _Event_Manager_initialization
*
@@ -142,12 +154,13 @@ void _Event_Timeout (
);
/*
* The following defines the synchronization flag used by the
* The following defines the synchronization flags used by the
* Event Manager to insure that signals sent to the currently
* executing thread are received properly.
*/
EXTERN boolean _Event_Sync; /* event manager sync flag */
EXTERN volatile boolean _Event_Sync;
EXTERN volatile Event_Sync_states _Event_Sync_state;
#include <rtems/rtems/eventmp.h>
#include <rtems/rtems/event.inl>