Open TaqiHamoda opened 1 year ago
It has been a while and there is no reply. I tried doing a pull request but I got an unauthorized error. Since there is no support, I will post a diff of my changes in case anyone faces the same issue I did.
diff --git a/include/shared_memory/shared_memory.hpp b/include/shared_memory/shared_memory.hpp
index 0738b93..0c080ff 100644
--- a/include/shared_memory/shared_memory.hpp
+++ b/include/shared_memory/shared_memory.hpp
@@ -26,6 +26,7 @@
#include <Eigen/Dense>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/deque.hpp>
#include <boost/interprocess/containers/string.hpp>
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp
index 54bdbb8..b84fb42 100644
--- a/src/condition_variable.cpp
+++ b/src/condition_variable.cpp
@@ -48,7 +48,7 @@ void ConditionVariable::wait(Lock &lock)
bool ConditionVariable::timed_wait(Lock &lock, long wait_nano_seconds)
{
boost::posix_time::ptime current_time =
- boost::interprocess::microsec_clock::universal_time();
+ boost::posix_time::microsec_clock::universal_time();
boost::posix_time::time_duration waiting_time =
boost::posix_time::microseconds(
static_cast<long>(static_cast<double>(wait_nano_seconds) * 0.001));
diff --git a/src/locked_condition_variable.cpp b/src/locked_condition_variable.cpp
index d3fafb1..17221f3 100644
--- a/src/locked_condition_variable.cpp
+++ b/src/locked_condition_variable.cpp
@@ -62,7 +62,7 @@ bool LockedConditionVariable::timed_wait(long wait_nano_seconds)
if (lock_)
{
boost::posix_time::ptime current_time =
- boost::interprocess::microsec_clock::universal_time();
+ boost::posix_time::microsec_clock::universal_time();
boost::posix_time::time_duration waiting_time =
boost::posix_time::microseconds(static_cast<long>(
static_cast<double>(wait_nano_seconds) * 0.001));
I am trying to build the library but I get the following compilation errors:
These issues were resolved when I added the
#include <boost/date_time/posix_time/posix_time.hpp>
header toshared_memory.hpp
. There are other compilation issues that are also resolved by adding the appropriate headers.