Reset "inited" in the unsync mode so as to avoid expensive atomic operation by
[charm.git] / NodeHelper.h
index de5c737889bcdfaa42c003e8f76257e3467cf7c5..14ca7c74ed1ac225dea740419eb93b90ea735e80 100644 (file)
@@ -67,9 +67,9 @@ public:
         inited = 1;
     }
       
-    void waitLoopDone(){
+    void waitLoopDone(int sync){
         //while(!__sync_bool_compare_and_swap(&finishFlag, numChunks, 0));
-       while(finishFlag!=numChunks);
+       if(sync) while(finishFlag!=numChunks);
        //finishFlag = 0;
         inited = 0;
     }