Merge pull request #300 from YosysHQ/static_build_fix
Switching from std to boost fix crash
This commit is contained in:
commit
19cb4ca554
@ -26,13 +26,13 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
#ifndef NEXTPNR_H
|
#ifndef NEXTPNR_H
|
||||||
#define NEXTPNR_H
|
#define NEXTPNR_H
|
||||||
@ -533,7 +533,7 @@ struct BaseCtx
|
|||||||
{
|
{
|
||||||
// Lock to perform mutating actions on the Context.
|
// Lock to perform mutating actions on the Context.
|
||||||
std::mutex mutex;
|
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()
|
// 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
|
// method will lock/unlock it when its' released the main mutex to make
|
||||||
@ -583,12 +583,12 @@ struct BaseCtx
|
|||||||
void lock(void)
|
void lock(void)
|
||||||
{
|
{
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
mutex_owner = std::this_thread::get_id();
|
mutex_owner = boost::this_thread::get_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
void unlock(void)
|
void unlock(void)
|
||||||
{
|
{
|
||||||
NPNR_ASSERT(std::this_thread::get_id() == mutex_owner);
|
NPNR_ASSERT(boost::this_thread::get_id() == mutex_owner);
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@
|
|||||||
#include <Eigen/Core>
|
#include <Eigen/Core>
|
||||||
#include <Eigen/IterativeLinearSolvers>
|
#include <Eigen/IterativeLinearSolvers>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <thread>
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -154,7 +154,7 @@ class HeAPPlacer
|
|||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
setup_solve_cells();
|
setup_solve_cells();
|
||||||
auto solve_startt = std::chrono::high_resolution_clock::now();
|
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);
|
build_solve_direction(true, -1);
|
||||||
xaxis.join();
|
xaxis.join();
|
||||||
auto solve_endt = std::chrono::high_resolution_clock::now();
|
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(false, (iter == 0) ? -1 : iter);
|
||||||
build_solve_direction(true, (iter == 0) ? -1 : iter);
|
build_solve_direction(true, (iter == 0) ? -1 : iter);
|
||||||
} else {
|
} 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);
|
build_solve_direction(true, (iter == 0) ? -1 : iter);
|
||||||
xaxis.join();
|
xaxis.join();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user