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/02/15 23:56:15 UTC
svn commit: r1244778 -
/incubator/mesos/trunk/third_party/libprocess/src/process.cpp
Author: benh
Date: Wed Feb 15 22:56:14 2012
New Revision: 1244778
URL: http://svn.apache.org/viewvc?rev=1244778&view=rev
Log:
Made some synchronizers recursive (after experiencing some deadlocks) and replace IPPROTO with 0 as was supposed to do in the last review.
Modified:
incubator/mesos/trunk/third_party/libprocess/src/process.cpp
Modified: incubator/mesos/trunk/third_party/libprocess/src/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/src/process.cpp?rev=1244778&r1=1244777&r2=1244778&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/src/process.cpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/src/process.cpp Wed Feb 15 22:56:14 2012
@@ -1236,7 +1236,7 @@ void initialize(const string& delegate,
}
// Create a "server" socket for communicating with other nodes.
- if ((__s__ = socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) < 0) {
+ if ((__s__ = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
PLOG(FATAL) << "Failed to initialize, socket";
}
@@ -1542,7 +1542,7 @@ void SocketManager::link(ProcessBase* pr
// Okay, no link, lets create a socket.
int s;
- if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) < 0) {
+ if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
PLOG(FATAL) << "Failed to link, socket";
}
@@ -1683,7 +1683,7 @@ void SocketManager::send(Message* messag
// exists, so we create a temporary one.
int s;
- if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) < 0) {
+ if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
PLOG(FATAL) << "Failed to send, socket";
}
@@ -1918,8 +1918,8 @@ void SocketManager::exited(ProcessBase*
ProcessManager::ProcessManager(const string& _delegate)
: delegate(_delegate)
{
- synchronizer(processes) = SYNCHRONIZED_INITIALIZER;
- synchronizer(runq) = SYNCHRONIZED_INITIALIZER;
+ synchronizer(processes) = SYNCHRONIZED_INITIALIZER_RECURSIVE;
+ synchronizer(runq) = SYNCHRONIZED_INITIALIZER_RECURSIVE;
running = 0;
__sync_synchronize(); // Ensure write to 'running' visible in other threads.
}
@@ -2687,7 +2687,7 @@ void ProcessBase::visit(const HttpEvent&
dispatch(proxy, &HttpProxy::handle, future, event.request->keepAlive);
// Now call the handler and associate the response with the promise.
- internal::associate(handlers.http[name](*event.request), promise);
+ promise->associate(handlers.http[name](*event.request));
} else if (resources.count(name) > 0) {
HttpOKResponse response;
response.headers["Content-Type"] = resources[name].type;