mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-19 00:07:55 +08:00
41 lines
1.1 KiB
Diff
41 lines
1.1 KiB
Diff
|
diff --git a/include/fastrtps/utils/TimedMutex.hpp b/include/fastrtps/utils/TimedMutex.hpp
|
||
|
index 8d5d968..7ba3e00 100644
|
||
|
--- a/include/fastrtps/utils/TimedMutex.hpp
|
||
|
+++ b/include/fastrtps/utils/TimedMutex.hpp
|
||
|
@@ -23,10 +23,14 @@
|
||
|
#include <iostream>
|
||
|
|
||
|
#if defined(_WIN32)
|
||
|
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
|
||
|
+#include <mutex>
|
||
|
+#else
|
||
|
#include <thread>
|
||
|
extern int clock_gettime(
|
||
|
int,
|
||
|
struct timespec* tv);
|
||
|
+#endif // if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
|
||
|
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK
|
||
|
#include <mutex>
|
||
|
#else
|
||
|
@@ -37,6 +41,11 @@ namespace eprosima {
|
||
|
namespace fastrtps {
|
||
|
|
||
|
#if defined(_WIN32)
|
||
|
+
|
||
|
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
|
||
|
+using TimedMutex = std::timed_mutex;
|
||
|
+using RecursiveTimedMutex = std::recursive_timed_mutex;
|
||
|
+#else
|
||
|
class TimedMutex
|
||
|
{
|
||
|
public:
|
||
|
@@ -182,6 +191,8 @@ private:
|
||
|
|
||
|
_Mtx_t mutex_;
|
||
|
};
|
||
|
+#endif // if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
|
||
|
+
|
||
|
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK || !defined(__unix__)
|
||
|
using TimedMutex = std::timed_mutex;
|
||
|
using RecursiveTimedMutex = std::recursive_timed_mutex;
|