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 07:41:59 UTC
svn commit: r1131862 - in /incubator/mesos/trunk/src/third_party/libprocess:
process.cpp process.hpp
Author: benh
Date: Sun Jun 5 05:41:58 2011
New Revision: 1131862
URL: http://svn.apache.org/viewvc?rev=1131862&view=rev
Log:
Removing bad artifacts from previous commits after self review.
Modified:
incubator/mesos/trunk/src/third_party/libprocess/process.cpp
incubator/mesos/trunk/src/third_party/libprocess/process.hpp
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=1131862&r1=1131861&r2=1131862&view=diff
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/process.cpp (original)
+++ incubator/mesos/trunk/src/third_party/libprocess/process.cpp Sun Jun 5 05:41:58 2011
@@ -2513,7 +2513,6 @@ void handle_timeout(struct ev_loop *loop
for (; it != timers->end(); ++it) {
// Check if timer has expired.
ev_tstamp tstamp = it->first;
- cout.precision(20);
if (tstamp > current_tstamp) {
last = it;
break;
@@ -3139,9 +3138,9 @@ Process::Process()
initialize();
#ifdef USE_LITHE
- l_lock = UNLOCKED;
+ l = UNLOCKED;
#else
- pthread_mutex_init(&m_mutex, NULL);
+ pthread_mutex_init(&m, NULL);
#endif /* USE_LITHE */
current = NULL;
@@ -3203,23 +3202,20 @@ Process::~Process()
void Process::enqueue(struct msg *msg)
{
assert(msg != NULL);
- lock();
- {
- assert (state != EXITED);
- acquire(filter);
- {
- if (filtering) {
- assert(filterer != NULL);
- if (filterer->filter(msg)) {
- free(msg);
- release(filter);
- unlock();
- return;
- }
+ synchronized(filter) {
+ if (filtering) {
+ assert(filterer != NULL);
+ if (filterer->filter(msg)) {
+ free(msg);
+ return;
}
}
- release(filter);
+ }
+
+ lock();
+ {
+ assert (state != EXITED);
msgs.push_back(msg);
@@ -3298,22 +3294,18 @@ void Process::inject(const PID &from, MS
if (length > 0)
memcpy((char *) msg + sizeof(struct msg), data, length);
- lock();
- {
- acquire(filter);
- {
- if (filtering) {
- assert(filterer != NULL);
- if (filterer->filter(msg)) {
- free(msg);
- release(filter);
- unlock();
- return;
- }
+ synchronized(filter) {
+ if (filtering) {
+ assert(filterer != NULL);
+ if (filterer->filter(msg)) {
+ free(msg);
+ return;
}
}
- release(filter);
+ }
+ lock();
+ {
msgs.push_front(msg);
}
unlock();
Modified: incubator/mesos/trunk/src/third_party/libprocess/process.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/process.hpp?rev=1131862&r1=1131861&r2=1131862&view=diff
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/process.hpp (original)
+++ incubator/mesos/trunk/src/third_party/libprocess/process.hpp Sun Jun 5 05:41:58 2011
@@ -144,13 +144,13 @@ private:
/* Lock/mutex protecting internals. */
#ifdef USE_LITHE
- int l_lock;
- void lock() { spinlock_lock(&l_lock); }
- void unlock() { spinlock_unlock(&l_lock); }
+ int l;
+ void lock() { spinlock_lock(&l); }
+ void unlock() { spinlock_unlock(&l); }
#else
- pthread_mutex_t m_mutex;
- void lock() { pthread_mutex_lock(&m_mutex); }
- void unlock() { pthread_mutex_unlock(&m_mutex); }
+ pthread_mutex_t m;
+ void lock() { pthread_mutex_lock(&m); }
+ void unlock() { pthread_mutex_unlock(&m); }
#endif /* USE_LITHE */
/* Enqueues the specified message. */