pull/1/head
Jeff Becker 6 years ago
parent 284c55f5aa
commit 6da13c876c
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -7,8 +7,7 @@ template <typename T>
static constexpr size_t alignment() {
size_t idx = 0;
size_t sz = sizeof(T);
while(sz)
{
while (sz) {
++idx;
sz >>= 1;
}

@ -39,7 +39,7 @@ void Pool::Join() {
for (auto &t : threads) t.join();
}
void Pool::QueueJob(const llarp_thread_job & job) {
void Pool::QueueJob(const llarp_thread_job &job) {
{
lock_t lock(queue_mutex);

@ -4,8 +4,8 @@
#include <llarp/threadpool.h>
#include <condition_variable>
#include <mutex>
#include <deque>
#include <mutex>
#include <thread>
#include <vector>
@ -15,7 +15,7 @@ typedef std::mutex mtx_t;
typedef std::unique_lock<mtx_t> lock_t;
struct Pool {
Pool(size_t sz);
void QueueJob(const llarp_thread_job & job);
void QueueJob(const llarp_thread_job& job);
void Join();
std::vector<std::thread> threads;
std::deque<llarp_thread_job> jobs;

Loading…
Cancel
Save