From a3b30749b0abe1c97c5d558fcd8d7239a52f0b5d Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Fri, 31 Aug 2007 12:34:48 +0000 Subject: [PATCH] - Only lock/unlock when using threads. Basically revert this part of r16015. This commit was SVN r16029. The following SVN revision numbers were found above: r16015 --> open-mpi/ompi@435e7d80e9f0b85034ffe89a51c2f2be2ad8b869 --- ompi/mca/btl/sm/btl_sm_fifo.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ompi/mca/btl/sm/btl_sm_fifo.h b/ompi/mca/btl/sm/btl_sm_fifo.h index 1a780ccd61..b997dc40bf 100644 --- a/ompi/mca/btl/sm/btl_sm_fifo.h +++ b/ompi/mca/btl/sm/btl_sm_fifo.h @@ -10,13 +10,15 @@ do { \ fifo=&(mca_btl_sm_component.fifo[peer_smp_rank][my_smp_rank]); \ \ /* thread lock */ \ - opal_atomic_lock(fifo->head_lock); \ + if(opal_using_threads()) \ + opal_atomic_lock(fifo->head_lock); \ /* post fragment */ \ while(ompi_fifo_write_to_head(hdr, fifo, \ mca_btl_sm_component.sm_mpool) != OMPI_SUCCESS) \ opal_progress(); \ MCA_BTL_SM_SIGNAL_PEER(endpoint_peer); \ - opal_atomic_unlock(fifo->head_lock); \ + if(opal_using_threads()) \ + opal_atomic_unlock(fifo->head_lock); \ } while(0) #endif