mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +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 {
|
||||
// 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();
|
||||
if (file) {
|
||||
return file;
|
||||
|
|
Loading…
Reference in a new issue