]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
heartbeatmap: fix stupid race
authorSage Weil <sage@newdream.net>
Thu, 28 Jul 2011 16:07:02 +0000 (09:07 -0700)
committerSage Weil <sage@newdream.net>
Thu, 28 Jul 2011 16:49:23 +0000 (09:49 -0700)
atomic_t is probably better here, actually... :/

Signed-off-by: Sage Weil <sage@newdream.net>
src/common/HeartbeatMap.cc

index dc63d8ebb5c4866c65deec989938917c453be83b..8e47b590c4631d70b63cc51a59151125750b05ae 100644 (file)
@@ -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;