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 2012/12/11 00:59:40 UTC

svn commit: r1419900 - in /incubator/mesos/branches/0.10.x/third_party/libprocess: include/process/future.hpp include/process/latch.hpp include/process/process.hpp src/process.cpp src/tests.cpp

Author: benh
Date: Mon Dec 10 23:59:39 2012
New Revision: 1419900

URL: http://svn.apache.org/viewvc?rev=1419900&view=rev
Log:
*** MODIFIED FOR 0.10.0 ***
Changed semantics of process::wait (and thus Future::await and
Latch::await which are built on process::wait) so that
Timeout::remaining does what is expected once it reaches 0 (e.g.,
future.await(timeout.remaining()) should not block forever once
timeout.remaining() == 0).

Modified:
    incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/future.hpp
    incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/latch.hpp
    incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/process.hpp
    incubator/mesos/branches/0.10.x/third_party/libprocess/src/process.cpp
    incubator/mesos/branches/0.10.x/third_party/libprocess/src/tests.cpp

Modified: incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/future.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/future.hpp?rev=1419900&r1=1419899&r2=1419900&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/future.hpp (original)
+++ incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/future.hpp Mon Dec 10 23:59:39 2012
@@ -70,7 +70,7 @@ public:
   bool discard();
 
   // Waits for this future to become ready, discarded, or failed.
-  bool await(double secs = 0) const;
+  bool await(double secs = -1.0) const;
 
   // Return the value associated with this future, waits indefinitely
   // until a value gets associated or until the future is discarded.

Modified: incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/latch.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/latch.hpp?rev=1419900&r1=1419899&r2=1419900&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/latch.hpp (original)
+++ incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/latch.hpp Mon Dec 10 23:59:39 2012
@@ -15,7 +15,7 @@ public:
   bool operator < (const Latch& that) const { return pid < that.pid; }
 
   void trigger();
-  bool await(double secs = 0);
+  bool await(double secs = -1.0);
 
 private:
   // Not copyable, not assignable.

Modified: incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/process.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/process.hpp?rev=1419900&r1=1419899&r2=1419900&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/process.hpp (original)
+++ incubator/mesos/branches/0.10.x/third_party/libprocess/include/process/process.hpp Mon Dec 10 23:59:39 2012
@@ -297,9 +297,9 @@ void terminate(const ProcessBase* proces
  * @param PID id of the process
  * @param secs max time to wait, 0 implies wait for ever
  */
-bool wait(const UPID& pid, double secs = 0);
-bool wait(const ProcessBase& process, double secs = 0);
-bool wait(const ProcessBase* process, double secs = 0);
+bool wait(const UPID& pid, double secs = -1.0);
+bool wait(const ProcessBase& process, double secs = -1.0);
+bool wait(const ProcessBase* process, double secs = -1.0);
 
 
 /**

Modified: incubator/mesos/branches/0.10.x/third_party/libprocess/src/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.x/third_party/libprocess/src/process.cpp?rev=1419900&r1=1419899&r2=1419900&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.x/third_party/libprocess/src/process.cpp (original)
+++ incubator/mesos/branches/0.10.x/third_party/libprocess/src/process.cpp Mon Dec 10 23:59:39 2012
@@ -2954,7 +2954,7 @@ bool wait(const UPID& pid, double secs)
               << pid << " that it is currently executing." << std::endl;
   }
 
-  if (secs == 0) {
+  if (secs == -1.0) {
     return process_manager->wait(pid);
   }
 

Modified: incubator/mesos/branches/0.10.x/third_party/libprocess/src/tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.x/third_party/libprocess/src/tests.cpp?rev=1419900&r1=1419899&r2=1419900&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.x/third_party/libprocess/src/tests.cpp (original)
+++ incubator/mesos/branches/0.10.x/third_party/libprocess/src/tests.cpp Mon Dec 10 23:59:39 2012
@@ -228,6 +228,8 @@ TEST(Process, spawn)
 
   ASSERT_FALSE(!pid);
 
+  ASSERT_FALSE(wait(pid, 0));
+
   terminate(pid);
   wait(pid);
 }