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:
parent
246ff605c4
commit
5c064d7ddc
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue