]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
added some consts 3011/head
authorMichal Jarzabek <stiopa@gmail.com>
Tue, 25 Nov 2014 20:58:04 +0000 (20:58 +0000)
committerMichal Jarzabek <stiopa@gmail.com>
Tue, 25 Nov 2014 20:58:04 +0000 (20:58 +0000)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/common/Thread.cc
src/common/Thread.h
src/msg/simple/DispatchQueue.cc
src/msg/simple/DispatchQueue.h

index a962e06f66a4db4a328472577105c3f01da5cc42..584e97bbd824772157b060b662d364fe0d53a03a 100644 (file)
@@ -66,7 +66,7 @@ const pthread_t &Thread::get_thread_id()
   return thread_id;
 }
 
-bool Thread::is_started()
+bool Thread::is_started() const
 {
   return thread_id != 0;
 }
index 8c0b74514926903cb5c9415a5d6c9da7eecf0b18..7889c913456772901fbb8ba72bc95fbb029ab308 100644 (file)
@@ -43,7 +43,7 @@ class Thread {
  public:
   const pthread_t &get_thread_id();
   pid_t get_pid() const { return pid; }
-  bool is_started();
+  bool is_started() const;
   bool am_self();
   int kill(int signal);
   int try_create(size_t stacksize);
index 12c48465ed3f633088af7adf060dcfac5212e005..c47ee72b81848f3cf837e319f802559beb99d732 100644 (file)
@@ -28,7 +28,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "-- " << msgr->get_myaddr() << " "
 
-double DispatchQueue::get_max_age(utime_t now) {
+double DispatchQueue::get_max_age(utime_t now) const {
   Mutex::Locker l(lock);
   if (marrival.empty())
     return 0;
@@ -60,7 +60,7 @@ void DispatchQueue::post_dispatch(Message *m, uint64_t msize)
   ldout(cct,20) << "done calling dispatch on " << m << dendl;
 }
 
-bool DispatchQueue::can_fast_dispatch(Message *m)
+bool DispatchQueue::can_fast_dispatch(Message *m) const
 {
   return msgr->ms_can_fast_dispatch(m);
 }
index a7e6a37037e02fcadad1226752e4757d2d46b5f6..21997cd054705aaee60e8756fafe8fc119590076 100644 (file)
@@ -49,15 +49,15 @@ class DispatchQueue {
     bool is_code() const {
       return type != -1;
     }
-    int get_code () {
+    int get_code () const {
       assert(is_code());
       return type;
     }
-    Message *get_message() {
+    Message *get_message() const {
       assert(!is_code());
       return m.get();
     }
-    Connection *get_connection() {
+    Connection *get_connection() const {
       assert(is_code());
       return con.get();
     }
@@ -65,7 +65,7 @@ class DispatchQueue {
     
   CephContext *cct;
   SimpleMessenger *msgr;
-  Mutex lock;
+  mutable Mutex lock;
   Cond cond;
 
   PrioritizedQueue<QueueItem, uint64_t> mqueue;
@@ -127,9 +127,9 @@ class DispatchQueue {
   void local_delivery(Message *m, int priority);
   void run_local_delivery();
 
-  double get_max_age(utime_t now);
+  double get_max_age(utime_t now) const;
 
-  int get_queue_len() {
+  int get_queue_len() const {
     Mutex::Locker l(lock);
     return mqueue.length();
   }
@@ -175,7 +175,7 @@ class DispatchQueue {
     cond.Signal();
   }
 
-  bool can_fast_dispatch(Message *m);
+  bool can_fast_dispatch(Message *m) const;
   void fast_dispatch(Message *m);
   void fast_preprocess(Message *m);
   void enqueue(Message *m, int priority, uint64_t id);
@@ -188,11 +188,11 @@ class DispatchQueue {
   void entry();
   void wait();
   void shutdown();
-  bool is_started() {return dispatch_thread.is_started();}
+  bool is_started() const {return dispatch_thread.is_started();}
 
   DispatchQueue(CephContext *cct, SimpleMessenger *msgr)
     : cct(cct), msgr(msgr),
-      lock("SimpleMessenger::DispatchQeueu::lock"), 
+      lock("SimpleMessenger::DispatchQueue::lock"),
       mqueue(cct->_conf->ms_pq_max_tokens_per_priority,
             cct->_conf->ms_pq_min_cost),
       next_pipe_id(1),