Skip to content

Commit

Permalink
iox-eclipse-iceoryx#337 enhance the comments and remove additional ne…
Browse files Browse the repository at this point in the history
…w line

Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
  • Loading branch information
shankar-in committed Apr 28, 2021
1 parent e5554a3 commit 15e8c8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion iceoryx_utils/include/iceoryx_utils/cxx/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Timer

/// @brief Starts the timer. This also calculates the time until the timer goes for sleep. This also acquires the
/// binary semaphore.
/// @param[in] interval the new duration until the timer sleeps and wakes up for execution
/// @param[in] interval The new duration until the timer sleeps and wakes up for execution
void start(const units::Duration interval) noexcept;

/// @brief Stops the timer. This also releases the acquired binary semaphore.
Expand Down
6 changes: 2 additions & 4 deletions iceoryx_utils/source/cxx/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ void Timer::stop() noexcept
}
}


const iox::units::Duration Timer::now() const noexcept
{
struct timespec ts;
Expand All @@ -60,9 +59,8 @@ const iox::units::Duration Timer::now() const noexcept

cxx::expected<iox::cxx::TimerEvent, posix::SemaphoreError> Timer::wait() noexcept
{
if (*(m_waitSemaphore.getValue())
== static_cast<int>(
posix::SemaphoreWaitState::TIMEOUT)) // To check if the TIMER is active (if the sempahore is acquired)
// To check if the TIMER is active (if the sempahore is acquired)
if (*(m_waitSemaphore.getValue()) == static_cast<int>(posix::SemaphoreWaitState::TIMEOUT))
{
if (now() > m_timeForNextActivation)
{
Expand Down

0 comments on commit 15e8c8a

Please sign in to comment.