1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
This commit is contained in:
Jeff Becker 2018-02-20 19:11:26 -05:00
parent 284c55f5aa
commit 6da13c876c
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
3 changed files with 4 additions and 5 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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;