add const to member functions
diff --git a/lib/cpp/src/thrift/concurrency/Thread.h b/lib/cpp/src/thrift/concurrency/Thread.h
index 729d11a..cacd401 100644
--- a/lib/cpp/src/thrift/concurrency/Thread.h
+++ b/lib/cpp/src/thrift/concurrency/Thread.h
@@ -153,7 +153,7 @@
/**
* Gets the thread's platform-specific ID
*/
- Thread::id_t getId() { return thread_.get() ? thread_->get_id() : std::thread::id(); }
+ Thread::id_t getId() const { return thread_.get() ? thread_->get_id() : std::thread::id(); }
/**
* Gets the runnable object this thread is hosting
diff --git a/lib/cpp/src/thrift/concurrency/ThreadManager.cpp b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
index 58025f9..5e88327 100644
--- a/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
+++ b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
@@ -110,7 +110,7 @@
return pendingTaskCountMax_;
}
- size_t expiredTaskCount() {
+ size_t expiredTaskCount() const {
Guard g(mutex_);
return expiredCount_;
}
diff --git a/lib/cpp/src/thrift/concurrency/ThreadManager.h b/lib/cpp/src/thrift/concurrency/ThreadManager.h
index 4b4b3d4..605e363 100644
--- a/lib/cpp/src/thrift/concurrency/ThreadManager.h
+++ b/lib/cpp/src/thrift/concurrency/ThreadManager.h
@@ -22,7 +22,6 @@
#include <functional>
#include <memory>
-#include <sys/types.h>
#include <thrift/concurrency/ThreadFactory.h>
namespace apache {
@@ -141,7 +140,7 @@
* Gets the number of tasks which have been expired without being run
* since start() was called.
*/
- virtual size_t expiredTaskCount() = 0;
+ virtual size_t expiredTaskCount() const = 0;
/**
* Adds a task to be executed at some time in the future by a worker thread.
diff --git a/lib/cpp/src/thrift/transport/TTransport.h b/lib/cpp/src/thrift/transport/TTransport.h
index d844239..d300f6b 100644
--- a/lib/cpp/src/thrift/transport/TTransport.h
+++ b/lib/cpp/src/thrift/transport/TTransport.h
@@ -63,7 +63,7 @@
/**
* Whether this transport is open.
*/
- virtual bool isOpen() { return false; }
+ virtual bool isOpen() const { return false; }
/**
* Tests whether there is more data to read or if the remote side is
@@ -73,7 +73,7 @@
* This is used by a server to check if it should listen for another
* request.
*/
- virtual bool peek() { return isOpen(); }
+ virtual bool peek() const { return isOpen(); }
/**
* Opens the transport for communications.