]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: add start() and wait() stubs to the Messenger interface
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 1 Mar 2012 22:06:42 +0000 (14:06 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 2 Mar 2012 19:20:24 +0000 (11:20 -0800)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/msg/Messenger.h
src/msg/SimpleMessenger.h

index 2c500c58535b4a3808984acd8fa4cd22e23b60d3..63885aebc4451b9ce52fb15e0344729029663f91 100644 (file)
@@ -182,7 +182,29 @@ protected:
     return false;
   }
 
+  // setup
+  /**
+   * Perform any resource allocation, thread startup, etc
+   * that is required before attempting to connect to other
+   * Messengers or transmit messages.
+   *
+   * @return 0 on success; -errno on failure.
+   */
+  virtual int start() = 0;
+
   // shutdown
+  /**
+   * Block until the Messenger has finished shutting down (according
+   * to the shutdown() function).
+   * It is valid to call this after calling shutdown(), but it must
+   * be called before deleting the Messenger.
+   */
+  virtual void wait() = 0;
+  /**
+   * Initiate a shutdown of the Messenger.
+   *
+   * @return 0 on success, -errno otherwise.
+   */
   virtual int shutdown() = 0;
   virtual void suicide() = 0;
 
index 75d37df89ddda6393d0404d89d8b88d16939649d..71f091edc0473263fb45112d1ae1df40dac13aa3 100644 (file)
@@ -530,11 +530,11 @@ public:
 
   int bind(entity_addr_t bind_addr, int64_t nonce);
   int start_with_nonce(uint64_t nonce);  // if we didn't bind
-  int start() {                 // if we did
+  virtual int start() {                 // if we did
     assert(did_bind);
     return start_with_nonce(0);
   }
-  void wait();
+  virtual void wait();
 
   void set_cluster_protocol(int p) {
     cluster_protocol = p;