1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

Silence spammy threadpool warning

This commit is contained in:
Michael 2019-07-17 10:23:46 +01:00
parent 246ff605c4
commit 5c064d7ddc
No known key found for this signature in database
GPG key ID: 2D51757B47E2434C
2 changed files with 19 additions and 6 deletions

View file

@ -5,6 +5,14 @@
#include <absl/synchronization/mutex.h>
#include <absl/time/time.h>
#ifdef WIN32
#include <process.h>
using pid_t = int;
#else
#include <sys/types.h>
#include <unistd.h>
#endif
namespace llarp
{
namespace util
@ -85,6 +93,15 @@ namespace llarp
void
SetThreadName(const std::string& name);
inline pid_t
GetPid()
{
#ifdef WIN32
return _getpid();
#else
return ::getpid();
}
} // namespace util
} // namespace llarp

View file

@ -4,16 +4,12 @@
#include <util/queue.hpp>
#include <util/string_view.hpp>
#include <util/thread_pool.hpp>
#include <util/threading.hpp>
#include <absl/base/thread_annotations.h>
#include <memory>
#include <queue>
#ifdef WIN32
#include <process.h>
using pid_t = int;
#endif
struct llarp_threadpool
{
std::unique_ptr< llarp::thread::ThreadPool > impl;
@ -30,7 +26,7 @@ struct llarp_threadpool
llarp_threadpool()
: jobs(new llarp::thread::Queue< std::function< void(void) > >(128))
, callingPID(::getpid())
, callingPID(llarp::util::GetPid())
{
jobs->enable();
}