avoid double locking
authorGengbin Zheng <gzheng@illinois.edu>
Sun, 1 Apr 2012 21:45:29 +0000 (16:45 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Sun, 1 Apr 2012 21:45:29 +0000 (16:45 -0500)
src/arch/gemini_gni/machine-persistent.c

index 23dd94c1b0f8a3a7ffae78c81e7d43db67c9f1b3..c575d48d1903f96ea50d04c102611bfa413bc3f7 100644 (file)
@@ -296,19 +296,27 @@ void setupRecvSlot(PersistentReceivesTable *slot, int maxBytes)
   }
   slot->sizeMax = maxBytes;
 #if REMOTE_EVENT
-  CmiLock(persistPool.lock);
+#if !MULTI_THREAD_SEND
+  CmiLock(persistPool.lock);    /* locked in function */
+#endif
   slot->index = IndexPool_getslot(&persistPool, slot, 2);
+#if !MULTI_THREAD_SEND
   CmiUnlock(persistPool.lock);
 #endif
+#endif
 }
 
 void clearRecvSlot(PersistentReceivesTable *slot)
 {
 #if REMOTE_EVENT
+#if !MULTI_THREAD_SEND
   CmiLock(persistPool.lock);
+#endif
   IndexPool_freeslot(&persistPool, slot->index);
+#if !MULTI_THREAD_SEND
   CmiUnlock(persistPool.lock);
 #endif
+#endif
 }
 
 PersistentHandle getPersistentHandle(PersistentHandle h, int toindex)