Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kpu/kenlm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2014-02-05 23:40:16 +0400
committerKenneth Heafield <github@kheafield.com>2014-02-18 00:42:05 +0400
commit07b751abb3b75b11bea70878f2f2e22c0e764f98 (patch)
tree581ea55e4f5677d037c449d2a2d6d6ec52069d16
parent94336065a2d6aedced20991a0aef6db6a8cacef0 (diff)
const
-rw-r--r--util/thread_pool.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/thread_pool.hh b/util/thread_pool.hh
index e56979b..da88826 100644
--- a/util/thread_pool.hh
+++ b/util/thread_pool.hh
@@ -18,7 +18,7 @@ template <class HandlerT> class Worker : boost::noncopyable {
typedef HandlerT Handler;
typedef typename Handler::Request Request;
- template <class Construct> Worker(PCQueue<Request> &in, Construct &construct, Request &poison)
+ template <class Construct> Worker(PCQueue<Request> &in, Construct &construct, const Request &poison)
: in_(in), handler_(construct), poison_(poison), thread_(boost::ref(*this)) {}
// Only call from thread.
@@ -30,7 +30,7 @@ template <class HandlerT> class Worker : boost::noncopyable {
try {
(*handler_)(request);
}
- catch(std::exception &e) {
+ catch(const std::exception &e) {
std::cerr << "Handler threw " << e.what() << std::endl;
abort();
}
@@ -50,7 +50,7 @@ template <class HandlerT> class Worker : boost::noncopyable {
boost::optional<Handler> handler_;
- Request poison_;
+ const Request poison_;
boost::thread thread_;
};