mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1405456 - in /incubator/mesos/branches/0.10.0/third_party/libprocess: include/process/future.hpp include/process/latch.hpp include/process/process.hpp src/process.cpp src/tests.cpp
Date Sun, 04 Nov 2012 01:29:19 GMT
Author: benh
Date: Sun Nov  4 01:29:18 2012
New Revision: 1405456

URL: http://svn.apache.org/viewvc?rev=1405456&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.0/third_party/libprocess/include/process/future.hpp
    incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/latch.hpp
    incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/process.hpp
    incubator/mesos/branches/0.10.0/third_party/libprocess/src/process.cpp
    incubator/mesos/branches/0.10.0/third_party/libprocess/src/tests.cpp

Modified: incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/future.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/future.hpp?rev=1405456&r1=1405455&r2=1405456&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/future.hpp (original)
+++ incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/future.hpp Sun
Nov  4 01:29:18 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.0/third_party/libprocess/include/process/latch.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/latch.hpp?rev=1405456&r1=1405455&r2=1405456&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/latch.hpp (original)
+++ incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/latch.hpp Sun Nov
 4 01:29:18 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.0/third_party/libprocess/include/process/process.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/process.hpp?rev=1405456&r1=1405455&r2=1405456&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/process.hpp (original)
+++ incubator/mesos/branches/0.10.0/third_party/libprocess/include/process/process.hpp Sun
Nov  4 01:29:18 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.0/third_party/libprocess/src/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/third_party/libprocess/src/process.cpp?rev=1405456&r1=1405455&r2=1405456&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/third_party/libprocess/src/process.cpp (original)
+++ incubator/mesos/branches/0.10.0/third_party/libprocess/src/process.cpp Sun Nov  4 01:29:18
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.0/third_party/libprocess/src/tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/third_party/libprocess/src/tests.cpp?rev=1405456&r1=1405455&r2=1405456&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/third_party/libprocess/src/tests.cpp (original)
+++ incubator/mesos/branches/0.10.0/third_party/libprocess/src/tests.cpp Sun Nov  4 01:29:18
2012
@@ -228,6 +228,8 @@ TEST(Process, spawn)
 
   ASSERT_FALSE(!pid);
 
+  ASSERT_FALSE(wait(pid, 0));
+
   terminate(pid);
   wait(pid);
 }



Mime
View raw message