dncurrency/nano/lib/threading.hpp
Piotr Wójcik 147a375e28
Configuration and environment variable improvements (#4613)
* Move env utilities to `nano::env::...`

* Env get_int helpers

* Hardware concurrency override

* App path override

* Convert legacy calls to `nano::env::get (...)`

* Use generic get

* Inform about environment overrides

* Consteval sanitizer info

* Print stats logging info

* Replace `get_env_threshold_or_default`

* Allow overriding io threads from env variable

* Ensure configured thread counts are in reasonable ranges

* Use `std::clamp`
2024-05-13 12:30:49 +02:00

26 lines
547 B
C++

#pragma once
#include <nano/lib/utility.hpp>
#include <boost/thread/thread.hpp>
#include <thread>
namespace nano
{
namespace thread_attributes
{
boost::thread::attributes get_default ();
} // namespace thread_attributes
/**
* Number of available logical processor cores. Might be overridden by setting `NANO_HARDWARE_CONCURRENCY` environment variable
*/
unsigned hardware_concurrency ();
/**
* If thread is joinable joins it, otherwise does nothing
* Returns thread.joinable()
*/
bool join_or_pass (std::thread &);
} // namespace nano