]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 9 Aug 2006 05:25:20 +0000 (05:25 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 9 Aug 2006 05:25:20 +0000 (05:25 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@793 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/common/Thread.h
ceph/msg/NewMessenger.cc
ceph/osdc/Objecter.h

index 8fe29df33fe4d97c270d0a35bf7957a6693376bb..845b761e619250932b53e2844c1c0007d6f1eb0d 100644 (file)
@@ -40,6 +40,10 @@ class Thread {
        return pthread_create( &thread_id, NULL, _entry_func, (void*)this );
   }
 
+  bool am_self() {
+       return (pthread_self() == thread_id);
+  }
+
   int join(void **prval = 0) {
        if (thread_id == 0) return -1;   // never started.
        int status = pthread_join(thread_id, prval);
index 740a92b33e328791fae51f3180f0c2180a47ec33..96149174f22bd819d2417f90f40fbc0a26ff3ed9 100644 (file)
@@ -1428,11 +1428,15 @@ int Rank::EntityMessenger::shutdown()
   rank.unregister_entity(this);
 
   // stop my dispatch thread
-  lock.Lock();
-  stop = true;
-  cond.Signal();
-  lock.Unlock();
-  dispatch_thread.join();
+  if (dispatch_thread.am_self()) 
+       stop = true;
+  else {
+       lock.Lock();
+       stop = true;
+       cond.Signal();
+       lock.Unlock();
+       dispatch_thread.join();
+  }
 
   return 0;
 }
index 6365ba8f4992432f6619a1f17096e410c815782e..309b0911690d69168553a16c011af091098e0ee2 100644 (file)
@@ -31,6 +31,7 @@ class Objecter {
   class OSDOp {
   public:
        list<ObjectExtent> extents;
+       virtual ~OSDOp() {}
   };
 
   class OSDRead : public OSDOp {