mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 13:22:53 +02:00
Add notes to KtxStorage::maybeOpenFile
This commit is contained in:
parent
eb9acad42e
commit
c36b85bb05
1 changed files with 5 additions and 0 deletions
|
@ -184,6 +184,11 @@ KtxStorage::KtxStorage(const std::string& filename) : _filename(filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<storage::FileStorage> KtxStorage::maybeOpenFile() const {
|
std::shared_ptr<storage::FileStorage> KtxStorage::maybeOpenFile() const {
|
||||||
|
// 1. Try to get the shared ptr
|
||||||
|
// 2. If it doesn't exist, grab the mutex around its creation
|
||||||
|
// 3. If it was created before we got the mutex, return it
|
||||||
|
// 4. Otherwise, create it
|
||||||
|
|
||||||
std::shared_ptr<storage::FileStorage> file = _cacheFile.lock();
|
std::shared_ptr<storage::FileStorage> file = _cacheFile.lock();
|
||||||
if (file) {
|
if (file) {
|
||||||
return file;
|
return file;
|
||||||
|
|
Loading…
Reference in a new issue