Something like the following? In order to avoid reading a cached _reopen_logs value set from the async handler thread I would think it needs to be read under the mutex since the flag vars are no longer volatile, but we could read it into a stack var and unlock before doing I/O.

```
diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc
index 4382dbf..33d800e 100644
--- a/src/common/ceph_context.cc
+++ b/src/common/ceph_context.cc
@@ -49,8 +49,7 @@ public:
   void *entry()
   {
     while (1) {
-      Mutex::Locker l(_lock);
-
+      _lock.Lock();
       if (_cct->_conf->heartbeat_interval) {
         utime_t interval(_cct->_conf->heartbeat_interval, 0);
         _cond.WaitInterval(_cct, _lock, interval);
@@ -60,13 +59,16 @@ public:
       if (_exit_thread) {
         break;
       }
+      _lock.Unlock();
 
       if (_reopen_logs) {
         _cct->_log->reopen_log_file();
```