Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves support for Unix POSIX systems. [12392] #2167

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/fastrtps/utils/TimedConditionVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#define CV_T_ _Cnd_t

extern int clock_gettime(int, struct timespec* tv);
#elif HAVE_STRICT_REALTIME && defined(__linux__)
#elif HAVE_STRICT_REALTIME && defined(__unix__)
*/
#if HAVE_STRICT_REALTIME && defined(__linux__)
#if HAVE_STRICT_REALTIME && defined(__unix__)
#include <pthread.h>

#define CV_INIT_(x) pthread_cond_init(x, NULL);
Expand All @@ -50,7 +50,7 @@
#define CV_T_ pthread_cond_t
#else
#include <condition_variable>
#endif // if HAVE_STRICT_REALTIME && defined(__linux__)
#endif // if HAVE_STRICT_REALTIME && defined(__unix__)

#include <mutex>
#include <chrono>
Expand All @@ -59,7 +59,7 @@
namespace eprosima {
namespace fastrtps {

#if HAVE_STRICT_REALTIME && (/*defined(_WIN32) ||*/ defined(__linux__))
#if HAVE_STRICT_REALTIME && (/*defined(_WIN32) ||*/ defined(__unix__))

class TimedConditionVariable
{
Expand Down Expand Up @@ -164,7 +164,7 @@ class TimedConditionVariable
};
#else
using TimedConditionVariable = std::condition_variable_any;
#endif // HAVE_STRICT_REALTIME && (/*defined(_WIN32)*/ || defined(__linux__))
#endif // HAVE_STRICT_REALTIME && (/*defined(_WIN32)*/ || defined(__unix__))

} // namespace fastrtps
} // namespace eprosima
Expand Down
2 changes: 1 addition & 1 deletion include/fastrtps/utils/TimedMutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class RecursiveTimedMutex

_Mtx_t mutex_;
};
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK || !defined(__linux__)
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK || !defined(__unix__)
using TimedMutex = std::timed_mutex;
using RecursiveTimedMutex = std::recursive_timed_mutex;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/reader/WriterProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "rtps/RTPSDomainImpl.hpp"
#include "utils/collections/node_size_helpers.hpp"

#if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__linux__)
#if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__unix__)
#define SHOULD_DEBUG_LINUX
#endif // SHOULD_DEBUG_LINUX

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/reader/WriterProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ class WriterProxy : public RTPSMessageSenderInterface

using ChangeIterator = decltype(changes_received_)::iterator;

#if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__linux__)
#if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__unix__)
int get_mutex_owner() const;

int get_thread_id() const;
#endif // if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__linux__)
#endif // if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__unix__)
};

} /* namespace rtps */
Expand Down