projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanups
[invirt/third/libt4.git]
/
rpc
/
thr_pool.cc
diff --git
a/rpc/thr_pool.cc
b/rpc/thr_pool.cc
index
73f94f4
..
ff3557c
100644
(file)
--- a/
rpc/thr_pool.cc
+++ b/
rpc/thr_pool.cc
@@
-5,10
+5,10
@@
// if blocking, then addJob() blocks when queue is full
// otherwise, addJob() simply returns false when queue is full
// if blocking, then addJob() blocks when queue is full
// otherwise, addJob() simply returns false when queue is full
-ThrPool::ThrPool(int sz, bool blocking)
+ThrPool::ThrPool(size_t sz, bool blocking)
: nthreads_(sz),blockadd_(blocking),jobq_(100*sz)
{
: nthreads_(sz),blockadd_(blocking),jobq_(100*sz)
{
- for (int i=0; i<nthreads_; i++)
+ for (size_t i=0; i<nthreads_; i++)
th_.emplace_back(&ThrPool::do_worker, this);
}
th_.emplace_back(&ThrPool::do_worker, this);
}
@@
-16,10
+16,10
@@
ThrPool::ThrPool(int sz, bool blocking)
// will ever use this thread pool again or is currently blocking on it
ThrPool::~ThrPool()
{
// will ever use this thread pool again or is currently blocking on it
ThrPool::~ThrPool()
{
- for (int i=0; i<nthreads_; i++)
+ for (size_t i=0; i<nthreads_; i++)
jobq_.enq(job_t());
jobq_.enq(job_t());
- for (int i=0; i<nthreads_; i++)
+ for (size_t i=0; i<nthreads_; i++)
th_[i].join();
}
th_[i].join();
}