From bd694bda19728f17ff0a9951952e24d8a65e9bc2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 5 Jul 2019 10:22:42 +0200 Subject: Switching from std to boost fix crash --- common/nextpnr.h | 8 ++++---- common/placer_heap.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index 3f434580..1f22e65a 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -26,13 +26,13 @@ #include #include #include -#include #include #include #include #include #include +#include #ifndef NEXTPNR_H #define NEXTPNR_H @@ -533,7 +533,7 @@ struct BaseCtx { // Lock to perform mutating actions on the Context. std::mutex mutex; - std::thread::id mutex_owner; + boost::thread::id mutex_owner; // Lock to be taken by UI when wanting to access context - the yield() // method will lock/unlock it when its' released the main mutex to make @@ -583,12 +583,12 @@ struct BaseCtx void lock(void) { mutex.lock(); - mutex_owner = std::this_thread::get_id(); + mutex_owner = boost::this_thread::get_id(); } void unlock(void) { - NPNR_ASSERT(std::this_thread::get_id() == mutex_owner); + NPNR_ASSERT(boost::this_thread::get_id() == mutex_owner); mutex.unlock(); } diff --git a/common/placer_heap.cc b/common/placer_heap.cc index cd800085..d1f5a974 100644 --- a/common/placer_heap.cc +++ b/common/placer_heap.cc @@ -37,12 +37,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include "log.h" @@ -154,7 +154,7 @@ class HeAPPlacer for (int i = 0; i < 4; i++) { setup_solve_cells(); auto solve_startt = std::chrono::high_resolution_clock::now(); - std::thread xaxis([&]() { build_solve_direction(false, -1); }); + boost::thread xaxis([&]() { build_solve_direction(false, -1); }); build_solve_direction(true, -1); xaxis.join(); auto solve_endt = std::chrono::high_resolution_clock::now(); @@ -208,7 +208,7 @@ class HeAPPlacer build_solve_direction(false, (iter == 0) ? -1 : iter); build_solve_direction(true, (iter == 0) ? -1 : iter); } else { - std::thread xaxis([&]() { build_solve_direction(false, (iter == 0) ? -1 : iter); }); + boost::thread xaxis([&]() { build_solve_direction(false, (iter == 0) ? -1 : iter); }); build_solve_direction(true, (iter == 0) ? -1 : iter); xaxis.join(); } -- cgit v1.2.3