Skip to content

Commit c749d7d

Browse files
committed
Merge pull request #1470 from hjelmn/fifo_fix
opal/fifo: use atomics to set fifo head in opal_fifo_push
2 parents 361f931 + dc00021 commit c749d7d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opal/class/opal_fifo.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2007 Voltaire All rights reserved.
1414
* Copyright (c) 2010 IBM Corporation. All rights reserved.
15-
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
1616
* reseved.
1717
* $COPYRIGHT$
1818
*
@@ -101,7 +101,8 @@ static inline opal_list_item_t *opal_fifo_push_atomic (opal_fifo_t *fifo,
101101

102102
if (&fifo->opal_fifo_ghost == tail.data.item) {
103103
/* update the head */
104-
fifo->opal_fifo_head.data.item = item;
104+
opal_counted_pointer_t head = {.value = fifo->opal_fifo_head.value};
105+
opal_update_counted_pointer (&fifo->opal_fifo_head, head, item);
105106
} else {
106107
/* update previous item */
107108
tail.data.item->opal_list_next = item;

0 commit comments

Comments
 (0)