Skip to content

Commit bd18d9c

Browse files
author
Ralph Castain
committed
Ensure the compiler knows that a critical variable is volatile
1 parent 91c54d7 commit bd18d9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

orte/mca/rml/base/rml_base_frame.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int orte_rml_base_register(mca_base_register_flag_t flags)
7878

7979
static void cleanup(int sd, short args, void *cbdata)
8080
{
81-
bool *active = (bool*)cbdata;
81+
volatile bool *active = (volatile bool*)cbdata;
8282

8383
OPAL_LIST_DESTRUCT(&orte_rml_base.posted_recvs);
8484
if (NULL != active) {
@@ -88,7 +88,7 @@ static void cleanup(int sd, short args, void *cbdata)
8888

8989
static int orte_rml_base_close(void)
9090
{
91-
bool active;
91+
volatile bool active;
9292

9393
orte_rml_base_active_t *active_module;
9494

@@ -109,7 +109,7 @@ static int orte_rml_base_close(void)
109109
opal_event_t ev;
110110
active = true;
111111
opal_event_set(orte_event_base, &ev, -1,
112-
OPAL_EV_WRITE, cleanup, &active);
112+
OPAL_EV_WRITE, cleanup, (void*)&active);
113113
opal_event_set_priority(&ev, ORTE_ERROR_PRI);
114114
opal_event_active(&ev, OPAL_EV_WRITE, 1);
115115
ORTE_WAIT_FOR_COMPLETION(active);

0 commit comments

Comments
 (0)