Skip to content

Commit

Permalink
Improves support for Unix POSIX systems. [12392] (#2167)
Browse files Browse the repository at this point in the history
* Fixes #2164 STRICT_REALTIME for Unix POSIX systems.

Signed-off-by: promero <promero@mathworks.com>

* Fixes #2166. Enable debug mode for Unix POSIX systems.

Signed-off-by: promero <promero@mathworks.com>
  • Loading branch information
pablorcum authored Sep 2, 2021
1 parent fdad27a commit c989f0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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

0 comments on commit c989f0b

Please sign in to comment.