summaryrefslogtreecommitdiffstats
path: root/src/common/HeartbeatMap.cc
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-07-28 18:07:02 +0200
committerSage Weil <sage@newdream.net>2011-07-28 18:49:23 +0200
commit7aad8f03e0ee78ea7ce192a454a8453cde19688f (patch)
tree85f43920344571dbe821e1115e8d0da0e141fb84 /src/common/HeartbeatMap.cc
parentheartbeatmap: use a list<> instead of map<> (diff)
downloadceph-7aad8f03e0ee78ea7ce192a454a8453cde19688f.tar.xz
ceph-7aad8f03e0ee78ea7ce192a454a8453cde19688f.zip
heartbeatmap: fix stupid race
atomic_t is probably better here, actually... :/ Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/common/HeartbeatMap.cc')
-rw-r--r--src/common/HeartbeatMap.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/HeartbeatMap.cc b/src/common/HeartbeatMap.cc
index dc63d8ebb5c..8e47b590c46 100644
--- a/src/common/HeartbeatMap.cc
+++ b/src/common/HeartbeatMap.cc
@@ -68,7 +68,8 @@ bool HeartbeatMap::is_healthy()
p != m_workers.end();
++p) {
heartbeat_handle_d *h = *p;
- if (h->timeout && h->timeout < now) {
+ time_t timeout = h->timeout;
+ if (timeout && timeout < now) {
ldout(m_cct, 0) << "is_healthy " << h->thread << " '" << h->name << "'"
<< " timed out" << dendl;
healthy = false;