boostorg / boostorg/interprocess
file_lock can't be used with scoped_lock because file_lock::internal_mutex_type is not defined
- Vorherrschende Sprache
- C++
- Sterne
- 185
- Forks
- 131
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
For Boost version: 1.86.0
The documentation [here](https://live.boost.org/doc/libs/1_85_0/doc/html/boost/interprocess/file_lock.html) 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](https://live.boost.org/doc/libs/1_85_0/doc/html/boost/interprocess/scoped_lock.html) and [sharable_lock](https://live.boost.org/doc/libs/1_85_0/doc/html/boost/interprocess/sharable_lock.html) 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 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::mutex_type’ {aka ‘class boost::interprocess::file_lock’}
35 | typedef typename Lock::mutex_type::internal_mutex_type mutex_type;
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne mit include/boost/interprocess/sync/detail/locks.hpp und der in der Issue verlinkten Dokumentation zu file_lock und scoped_lock. Reproduziere den gezeigten Kompilierungsfehler von scoped_lock und überprüfe anschließend, dass die dokumentierte Verwendung ohne den Fehler wegen des fehlenden internal_mutex_type erfolgreich kompiliert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100