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

Cleanup: CorbaDispatcher: Remove find retry, unsafe initialisation of mlock #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pierrewillenbrockdfki
Copy link

Concurrent use of ::Instance when mlock is not initialized would create two instances of the os::Mutex, which could then potentially both be used, since the compiler does not have to expect mlock to change and may cache its current value.

Creating an os::Mutex in global scope during library init is already used in rtt/transports/mqueue/Dispatcher.hpp.

… mlock

Concurrent use of ::Instance when mlock is not initialized would create
two instances of the os::Mutex, which could then potentially both be used,
since the compiler does not have to expect mlock to change and may cache
its current value.

Creating an os::Mutex in global scope during library init is already
used in rtt/transports/mqueue/Dispatcher.hpp.
@pierrewillenbrockdfki
Copy link
Author

@doudou i think this would be useful after you fixed the unlocked std::map::find usage.

@doudou doudou self-requested a review November 4, 2024 15:41
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.

1 participant