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

Readers writer lock #1699

Closed
wants to merge 2 commits into from
Closed

Readers writer lock #1699

wants to merge 2 commits into from

Conversation

biddisco
Copy link
Contributor

@biddisco biddisco commented Aug 1, 2015

A utility class for synchronization

This is a readers/writer lock which allows multiple readers to gain the lock
or a single writer and can be used to synchronize access to resources
such as containers between threads.
@biddisco
Copy link
Contributor Author

biddisco commented Aug 1, 2015

For the shared_mutex fix, you know best. I looked at it briefly and just threw in a mutex to shut the compiler up.

For the functionality, yes, I believe shared_lock does have the upgrade feature thrown in already, I wanted to make a simple utility to encapsulate it and this is #version 1 - I will do a version 2 which uses only shared lock. I wanted to get something that worked to start from and see your comments on it.

@biddisco
Copy link
Contributor Author

biddisco commented Aug 1, 2015

Closing this as I didn't realize that we could just instantiate a unique_lock over a shared mutex to achieve the same functionality

@biddisco biddisco closed this Aug 1, 2015
@hkaiser hkaiser deleted the readers_writer_lock branch August 1, 2015 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants