Skip to content

Commit

Permalink
Fix guard condition trigger error (#235)
Browse files Browse the repository at this point in the history
* Fix guard condition trigger error

* Use atomic bool exchange instead of lock
  • Loading branch information
DongheeYe authored and jacobperron committed Dec 19, 2018
1 parent a5675c4 commit 117eebe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rmw_fastrtps_shared_cpp/src/types/guard_condition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ class GuardCondition
bool
getHasTriggered()
{
bool ret = hasTriggered_;
hasTriggered_ = false;
return ret;
return hasTriggered_.exchange(false);
}

private:
Expand Down

0 comments on commit 117eebe

Please sign in to comment.