-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the LoanManager to do internal locking. (#552)
The original motivation to do this is to please the clang thread safety analysis, which can't quite figure out the locking regime with an external mutex. Instead, move major functionality into the LoanManager class, and then mark the item list as private. One thing to note is that the logic of __rmw_take_loaned_message_internal is slightly changed here. Before it would emplace an Item onto the LoanManager's list, then look through the data_reader to see if it could take an item. If it could, it would just fill that Item in and return. If it couldn't, it would pop that item out of the list. This commit changes it so that we instantiate a temporary Item. If we can take an item, we then push that Item into the LoanManager list. We never pop it. This should be equivalent (and slightly more performant), but is a change from what we had before. Signed-off-by: Chris Lalancette <[email protected]>
- Loading branch information
1 parent
1fd0702
commit ba50353
Showing
1 changed file
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters