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 2011/06/05 08:43:51 UTC

svn commit: r1131977 - /incubator/mesos/trunk/src/third_party/libprocess/process.cpp

Author: benh
Date: Sun Jun  5 06:43:51 2011
New Revision: 1131977

URL: http://svn.apache.org/viewvc?rev=1131977&view=rev
Log:
Cleaning up process lookup.

Modified:
    incubator/mesos/trunk/src/third_party/libprocess/process.cpp

Modified: incubator/mesos/trunk/src/third_party/libprocess/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/process.cpp?rev=1131977&r1=1131976&r2=1131977&view=diff
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/process.cpp (original)
+++ incubator/mesos/trunk/src/third_party/libprocess/process.cpp Sun Jun  5 06:43:51 2011
@@ -1689,11 +1689,13 @@ ProcessManager::~ProcessManager() {}
 
 ProcessReference ProcessManager::use(const PID &pid)
 {
-  synchronized(processes) {
-    if (processes.count(pid.pipe) > 0) {
-      // Note that the ProcessReference constructor MUST get called
-      // while holding the lock on processes.
-      return ProcessReference(processes[pid.pipe]);
+  if (pid.ip == ip && pid.port == port) {
+    synchronized(processes) {
+      if (processes.count(pid.pipe) > 0) {
+        // Note that the ProcessReference constructor MUST get called
+        // while holding the lock on processes.
+        return ProcessReference(processes[pid.pipe]);
+      }
     }
   }