fixed a bug when code in trapped CkWaitFuture(), the future can changed when the...
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 12 May 2011 18:13:27 +0000 (13:13 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 12 May 2011 18:13:27 +0000 (13:13 -0500)
src/ck-core/charm++.h
src/ck-core/ckfutures.C

index 225291a4781db2fae80ba17c8e2a535ab27c90a0..b4117e4d761cacd42263fc516ee3da911f3489c6 100644 (file)
@@ -1262,6 +1262,7 @@ public:
   }
 };
 
+PUPbytes(CkFuture)
 
 #endif
 
index f99117290ec15331bb0a01263afcba4587819d85..2113ebb436ad69299a0844fb108ba96516964bd6 100644 (file)
@@ -195,7 +195,7 @@ void *CkWaitFutureID(CkFutureID handle)
   if (!(fut->ready)) {
     CthSetNext(self, fut->waiters);
     fut->waiters = self;
-    while (!(fut->ready)) CthSuspend();
+    while (!(fut->ready)) { CthSuspend(); fut = (fs->array)+handle; }
   }
   fut = (fs->array)+handle;
   value = fut->value;
@@ -454,7 +454,6 @@ void CkSemaDestroy(CkSemaID id)
   CpvAccess(semapool)->release(id.idx);
 }
 
-PUPbytes(CkFuture);
 
 /*@}*/
 #include "CkFutures.def.h"