]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
dout:remove stream from dout_emerg_streams earlier
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 1 Jun 2011 18:52:31 +0000 (11:52 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 3 Jun 2011 21:47:31 +0000 (14:47 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/DoutStreambuf.cc

index 5aec02b8b7a2dc354619e8e32694542d935ef3da..b5612476bd2d7b9b87cc602dcb4b9106868d0b18 100644 (file)
@@ -184,11 +184,6 @@ DoutStreambuf<charT, traits>::DoutStreambuf()
 template <typename charT, typename traits>
 DoutStreambuf<charT, traits>::~DoutStreambuf()
 {
-  if (ofd != -1) {
-    TEMP_FAILURE_RETRY(::close(ofd));
-    ofd = -1;
-  }
-  pthread_mutex_destroy(&lock);
   simple_spin_lock(&dout_emergency_lock);
   for (size_t i = 0; i < NUM_DOUT_EMERG_STREAMS; ++i) {
     if (dout_emerg_streams[i] == this) {
@@ -197,6 +192,11 @@ DoutStreambuf<charT, traits>::~DoutStreambuf()
     }
   }
   simple_spin_unlock(&dout_emergency_lock);
+  if (ofd != -1) {
+    TEMP_FAILURE_RETRY(::close(ofd));
+    ofd = -1;
+  }
+  pthread_mutex_destroy(&lock);
 }
 
 // This function is called when the output buffer is filled.