]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add intrusive list anchor for Message dispatch to Message.
authorMatt Benjamin <matt@cohortfs.com>
Tue, 23 Dec 2014 20:51:44 +0000 (15:51 -0500)
committerMatt Benjamin <matt@cohortfs.com>
Wed, 14 Jan 2015 21:42:13 +0000 (16:42 -0500)
This is currently used by XioMessenger dispatch strategies, but
could be extended to other Messenger types.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
src/msg/Message.h

index 62e65886cadd41b78c459e48c128f99c04309562..87a23238d0cbd2d7cc79b6f8d8f6382637bba7bd 100644 (file)
 
 // abstract Message class
 
+namespace bi = boost::intrusive;
+
 class Message : public RefCountedObject {
 protected:
   ceph_msg_header  header;      // headerelope
@@ -203,6 +205,8 @@ protected:
 
   uint32_t magic;
 
+  bi::list_member_hook<> dispatch_q;
+
 public:
   class CompletionHook : public Context {
   protected:
@@ -215,6 +219,11 @@ public:
     virtual ~CompletionHook() {}
   };
 
+  typedef bi::list< Message,
+                   bi::member_hook< Message,
+                                    bi::list_member_hook<>,
+                                    &Message::dispatch_q > > Queue;
+
 protected:
   CompletionHook* completion_hook; // owned by Messenger