You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2017/11/20 00:54:25 UTC

[14/15] mesos git commit: Added discard happens-before relationship in process::await/collect.

Added discard happens-before relationship in process::await/collect.

Review: https://reviews.apache.org/r/61153


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/02ad5c8c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/02ad5c8c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/02ad5c8c

Branch: refs/heads/master
Commit: 02ad5c8cdd644ee8eec83bf887daa98bb163637d
Parents: 7a23273
Author: Benjamin Hindman <be...@gmail.com>
Authored: Thu Jan 5 21:08:32 2017 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Sun Nov 19 16:51:27 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/collect.hpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/02ad5c8c/3rdparty/libprocess/include/process/collect.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/collect.hpp b/3rdparty/libprocess/include/process/collect.hpp
index bdb57ef..7e07b1d 100644
--- a/3rdparty/libprocess/include/process/collect.hpp
+++ b/3rdparty/libprocess/include/process/collect.hpp
@@ -155,12 +155,15 @@ private:
 
   void discarded()
   {
-    promise->discard();
-
     foreach (Future<T> future, futures) {
       future.discard();
     }
 
+    // NOTE: we discard the promise after we set discard on each of
+    // the futures so that there is a happens-before relationship that
+    // can be assumed by callers.
+    promise->discard();
+
     terminate(this);
   }
 
@@ -231,12 +234,15 @@ private:
 
   void discarded()
   {
-    promise->discard();
-
     foreach (Future<T> future, futures) {
       future.discard();
     }
 
+    // NOTE: we discard the promise after we set discard on each of
+    // the futures so that there is a happens-before relationship that
+    // can be assumed by callers.
+    promise->discard();
+
     terminate(this);
   }