Skip to content

Commit

Permalink
iox eclipse-iceoryx#243 added deprecated comment to timer
Browse files Browse the repository at this point in the history
Signed-off-by: Killat Matthias (CC-AD/ESW1) <[email protected]>
  • Loading branch information
Killat Matthias (CC-AD/ESW1) committed Sep 14, 2020
1 parent d909548 commit c40ead1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions iceoryx_utils/include/iceoryx_utils/posix_wrapper/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ using namespace iox::units::duration_literals;
/// TiborTheTimer.stop();
///
/// @endcode

/// This class will be DEPRECATED in the near future. In its current form there may still be potential races when
/// start/stop/restart are called concurrently (this includes the callback, which is executed in a separate thread).
/// The implementation also has too much overhead in the callback execution (due to execution logic and potentially
/// multiple callback threads).
///
/// It will be replaced with simpler versions for individual use cases, such as a CountdownTimer which can be used for
/// watchdog/keepalive purposes.
class Timer
{
public:
Expand Down Expand Up @@ -122,6 +130,7 @@ class Timer
OsTimer* m_timer{nullptr};
};

/// This class will be DEPRECATED in the near future.
class OsTimer
{
#ifdef __QNX__
Expand Down
6 changes: 1 addition & 5 deletions iceoryx_utils/source/posix_wrapper/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,7 @@ Timer::OsTimer::~OsTimer() noexcept

m_timerId = INVALID_TIMER_ID;

// note that some of those relaxed loads and stores could be potential problems since they might
// be reordered within certain constraints which may lead to subtle but serious logical errors due to races
// (especially on architectures with weaker memory model)
// this cannot be fixed without detailed analysis and a redesign is advised
callbackHandle.m_inUse.store(false, std::memory_order_relaxed);
callbackHandle.m_inUse.store(false, std::memory_order_seq_cst);
}
}

Expand Down

0 comments on commit c40ead1

Please sign in to comment.