From eb384371ef82d6d6e2bd16bb30a147dc1afe8e9a Mon Sep 17 00:00:00 2001 From: Rich Graham Date: Sat, 28 Aug 2004 16:44:20 +0000 Subject: [PATCH] make changes to support shared memory implementation. This commit was SVN r2363. --- src/class/ompi_fifo.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/class/ompi_fifo.h b/src/class/ompi_fifo.h index 551dbb4908..7f031edf55 100644 --- a/src/class/ompi_fifo.h +++ b/src/class/ompi_fifo.h @@ -57,6 +57,10 @@ struct ompi_fifo_t { /* pointer to tail (read) ompi_cb_fifo_t structure */ volatile ompi_cb_fifo_wrapper_t *tail; + /* locks for thread synchronization */ + ompi_lock_t head_lock; + ompi_lock_t tail_lock; + }; typedef struct ompi_fifo_t ompi_fifo_t; @@ -131,6 +135,8 @@ static inline int ompi_fifo_init(int size_of_cb_fifo, int lazy_free_freq, fifo->head->cb_overflow=false; /* no attempt to overflow the queue */ fifo->head->fifo_allocator=memory_allocator; /* set pointer to memory allocation functions */ + ompi_atomic_unlock(&(fifo->head_lock)); + ompi_atomic_unlock(&(fifo->tail_lock)); /* set the tail */ fifo->tail=fifo->head;