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

update guard condition by managing multiple items #527

Conversation

iuhilnehc-ynos
Copy link
Contributor

@iuhilnehc-ynos iuhilnehc-ynos commented Apr 25, 2021

related to ros2/rclcpp#1611

Signed-off-by: Chen Lihui lihui.chen@sony.com

…ables

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@@ -80,8 +82,8 @@ class GuardCondition
private:
std::mutex internalMutex_;
std::atomic_bool hasTriggered_;
std::mutex * conditionMutex_ RCPPUTILS_TSA_GUARDED_BY(internalMutex_);
std::condition_variable * conditionVariable_ RCPPUTILS_TSA_GUARDED_BY(internalMutex_);
std::list<std::pair<std::mutex *, std::condition_variable *>> conditions_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make this a std::vector? The most common operations (in my opinion) will be trigger() which has to loop over this sequence of pairs. If removing a pair is expensive (inside of detachCondition()), I don't think that's as important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I'll update it.

@wjwwood
Copy link
Member

wjwwood commented Apr 26, 2021

CI:

  • Linux Build Status
  • Linux Build Status (without this patch, to show failing test)
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@iuhilnehc-ynos
Copy link
Contributor Author

iuhilnehc-ynos commented Apr 27, 2021

CI:

  • Linux Build Status

I noted this rmw_connextdds issue at the ros2/rclcpp#1611 (comment)

  • Linux Build Status (without this patch, to show failing test)

From the comments behind, I think running this CI is intent to use https://github.com/ros2/rclcpp/pull/1640 but not https://github.com/ros2/rmw_fastrtps/pull/527, but there is no repos_url setting for the CI parameter.

  • Linux-aarch64 Build Status

expected because of using use_connextdds: false

  • macOS Build Status

rmw_connextdds issue as metioned before.

  • Windows Build Status

rmw_connextdds issue as metioned before.

Co-authored-by: William Woodall <william@osrfoundation.org>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@iuhilnehc-ynos
Copy link
Contributor Author

@wjwwood

I have made a PR for rmw_connextdds

Comment on lines +41 to 43
// TODO(iuhilnehc-ynos): conditionMutex is not used, remove it
std::unique_lock<std::mutex> clock(*cond.first);
clock.unlock();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question, are these actually needed? just curious why not removing now?

@iuhilnehc-ynos
Copy link
Contributor Author

not a correct fix, close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants