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

file_lock can't be used with scoped_lock because file_lock::internal_mutex_type is not defined #235

Open
Tails86 opened this issue Oct 15, 2024 · 0 comments

Comments

@Tails86
Copy link

Tails86 commented Oct 15, 2024

For Boost version: 1.86.0

The documentation here states:
"A file lock, is a mutual exclusion utility similar to a mutex using a file. A file lock has sharable and exclusive locking capabilities and can be used with scoped_lock and sharable_lock classes."

When I try to use a scoped_lock with a file_lock like so:

boost::interprocess::file_lock* flk = nullptr; // Just for compilation testing purposes
boost::interprocess::scoped_lock<boost::interprocess::file_lock> lock(*flk);

I run into the following compile error:

include/boost/interprocess/sync/detail/locks.hpp:35:60: error: no type named ‘internal_mutex_type’ in ‘boost::interprocess::scoped_lock<boost::interprocess::file_lock>::mutex_type’ {aka ‘class boost::interprocess::file_lock’}
   35 |    typedef typename Lock::mutex_type::internal_mutex_type  mutex_type;
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

No branches or pull requests

1 participant