mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-16 15:57:39 +00:00
Fixed msys2 build crash
This commit is contained in:
parent
b56d027dd5
commit
998c2ba72f
4 changed files with 10 additions and 5 deletions
|
@ -54,7 +54,7 @@ public:
|
|||
: m_writePos(0)
|
||||
, m_readPos(0)
|
||||
{
|
||||
is_main_thread = true;
|
||||
set_main_thread();
|
||||
|
||||
m_logFile.open(log_file_name, std::ios::app | std::ios::binary);
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ void p2pool::handle_miner_data(MinerData& data)
|
|||
"\n---------------------------------------------------------------------------------------------------------------"
|
||||
);
|
||||
|
||||
if (!is_main_thread) {
|
||||
if (!is_main_thread()) {
|
||||
update_block_template_async();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -225,7 +225,7 @@ void uv_rwlock_init_checked(uv_rwlock_t* lock)
|
|||
|
||||
uv_loop_t* uv_default_loop_checked()
|
||||
{
|
||||
if (!is_main_thread) {
|
||||
if (!is_main_thread()) {
|
||||
LOGERR(1, "uv_default_loop() can only be used by the main thread. Fix the code!");
|
||||
#ifdef _WIN32
|
||||
if (IsDebuggerPresent()) {
|
||||
|
@ -339,7 +339,10 @@ void BackgroundJobTracker::print_status()
|
|||
}
|
||||
|
||||
BackgroundJobTracker bkg_jobs_tracker;
|
||||
thread_local bool is_main_thread = false;
|
||||
|
||||
static thread_local bool main_thread = false;
|
||||
void set_main_thread() { main_thread = true; }
|
||||
bool is_main_thread() { return main_thread; }
|
||||
|
||||
bool resolve_host(std::string& host, bool& is_v6)
|
||||
{
|
||||
|
|
|
@ -133,7 +133,9 @@ private:
|
|||
};
|
||||
|
||||
extern BackgroundJobTracker bkg_jobs_tracker;
|
||||
extern thread_local bool is_main_thread;
|
||||
|
||||
void set_main_thread();
|
||||
bool is_main_thread();
|
||||
|
||||
bool resolve_host(std::string& host, bool& is_v6);
|
||||
|
||||
|
|
Loading…
Reference in a new issue