From 9fd971de959061ef01fe80e73406e45184f1659c Mon Sep 17 00:00:00 2001 From: 766C6164 Date: Mon, 1 May 2023 23:43:57 -0400 Subject: [PATCH 1/3] Force using pthread emulation on FreeBSD --- include/chainbase/pinnable_mapped_file.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/chainbase/pinnable_mapped_file.hpp b/include/chainbase/pinnable_mapped_file.hpp index cd395aa..b00a2c9 100644 --- a/include/chainbase/pinnable_mapped_file.hpp +++ b/include/chainbase/pinnable_mapped_file.hpp @@ -1,10 +1,16 @@ #pragma once +// for BSD we should avoid any pthread calls such as pthread_mutex_lock +#if defined(__FreeBSD__) +#define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION +#endif + #include #include #include #include #include + namespace chainbase { namespace bip = boost::interprocess; From c7ca7381870d11a83ba4500d4bd4598c193cec17 Mon Sep 17 00:00:00 2001 From: 766C6164 Date: Wed, 3 May 2023 08:55:58 -0400 Subject: [PATCH 2/3] Moved BSD specific define into cmake --- CMakeLists.txt | 6 ++++++ include/chainbase/pinnable_mapped_file.hpp | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eec9e83..dd07377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,12 @@ if(WIN32) target_link_libraries( chainbase ws2_32 mswsock ) endif() +# for BSD we should avoid any pthread calls such as pthread_mutex_lock +# in boost/interprocess +if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + target_compile_definitions(chainbase PUBLIC BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) +endif() + enable_testing() add_subdirectory( test ) diff --git a/include/chainbase/pinnable_mapped_file.hpp b/include/chainbase/pinnable_mapped_file.hpp index b00a2c9..fdc71e7 100644 --- a/include/chainbase/pinnable_mapped_file.hpp +++ b/include/chainbase/pinnable_mapped_file.hpp @@ -1,10 +1,5 @@ #pragma once -// for BSD we should avoid any pthread calls such as pthread_mutex_lock -#if defined(__FreeBSD__) -#define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION -#endif - #include #include #include From cb7287912367a1c8bc8a6225bb76bcf501ced9f0 Mon Sep 17 00:00:00 2001 From: 766C6164 Date: Wed, 3 May 2023 08:57:34 -0400 Subject: [PATCH 3/3] Roll back space --- include/chainbase/pinnable_mapped_file.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/chainbase/pinnable_mapped_file.hpp b/include/chainbase/pinnable_mapped_file.hpp index fdc71e7..cd395aa 100644 --- a/include/chainbase/pinnable_mapped_file.hpp +++ b/include/chainbase/pinnable_mapped_file.hpp @@ -5,7 +5,6 @@ #include #include #include - namespace chainbase { namespace bip = boost::interprocess;