diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-23 04:42:29 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-23 04:42:29 +0200 |
commit | 7a136b8a84f9b21e120efe734f86725c46b8531b (patch) | |
tree | 23102d673fb6ab5a84e033d4360654d459fc41eb /src/core/file_sys | |
parent | removed duplicate rotl/rotr functions (diff) | |
download | yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar.gz yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar.bz2 yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar.lz yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar.xz yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.tar.zst yuzu-7a136b8a84f9b21e120efe734f86725c46b8531b.zip |
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/meta_file_system.cpp | 42 | ||||
-rw-r--r-- | src/core/file_sys/meta_file_system.h | 2 |
2 files changed, 22 insertions, 22 deletions
diff --git a/src/core/file_sys/meta_file_system.cpp b/src/core/file_sys/meta_file_system.cpp index 01048e498..4347ff451 100644 --- a/src/core/file_sys/meta_file_system.cpp +++ b/src/core/file_sys/meta_file_system.cpp @@ -161,7 +161,7 @@ static bool RealPath(const std::string ¤tDirectory, const std::string &inP IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); for (size_t i = 0; i < fileSystems.size(); i++) { if (fileSystems[i].system->OwnsHandle(handle)) @@ -173,7 +173,7 @@ IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle) bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpath, MountPoint **system) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string realpath; // Special handling: host0:command.txt (as seen in Super Monkey Ball Adventures, for example) @@ -227,7 +227,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat void MetaFileSystem::Mount(std::string prefix, IFileSystem *system) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); MountPoint x; x.prefix = prefix; x.system = system; @@ -236,7 +236,7 @@ void MetaFileSystem::Mount(std::string prefix, IFileSystem *system) void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); MountPoint x; x.prefix = prefix; x.system = system; @@ -245,7 +245,7 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system) void MetaFileSystem::Shutdown() { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); current = 6; // Ownership is a bit convoluted. Let's just delete everything once. @@ -267,7 +267,7 @@ void MetaFileSystem::Shutdown() u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); u32 h = OpenFile(filename, access, devicename); error = lastOpenError; return h; @@ -275,7 +275,7 @@ u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess a u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char *devicename) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); lastOpenError = 0; std::string of; MountPoint *mount; @@ -291,7 +291,7 @@ u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char FileInfo MetaFileSystem::GetFileInfo(std::string filename) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(filename, of, &system)) @@ -307,7 +307,7 @@ FileInfo MetaFileSystem::GetFileInfo(std::string filename) bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(inpath, of, &system)) { @@ -319,7 +319,7 @@ bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(path, of, &system)) @@ -335,13 +335,13 @@ std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path) void MetaFileSystem::ThreadEnded(int threadID) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); currentDir.erase(threadID); } int MetaFileSystem::ChDir(const std::string &dir) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); // Retain the old path and fail if the arg is 1023 bytes or longer. if (dir.size() >= 1023) return -1;//SCE_KERNEL_ERROR_NAMETOOLONG; @@ -378,7 +378,7 @@ int MetaFileSystem::ChDir(const std::string &dir) bool MetaFileSystem::MkDir(const std::string &dirname) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(dirname, of, &system)) @@ -393,7 +393,7 @@ bool MetaFileSystem::MkDir(const std::string &dirname) bool MetaFileSystem::RmDir(const std::string &dirname) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(dirname, of, &system)) @@ -408,7 +408,7 @@ bool MetaFileSystem::RmDir(const std::string &dirname) int MetaFileSystem::RenameFile(const std::string &from, const std::string &to) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; std::string rf; IFileSystem *osystem; @@ -440,7 +440,7 @@ int MetaFileSystem::RenameFile(const std::string &from, const std::string &to) bool MetaFileSystem::RemoveFile(const std::string &filename) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); std::string of; IFileSystem *system; if (MapFilePath(filename, of, &system)) @@ -455,7 +455,7 @@ bool MetaFileSystem::RemoveFile(const std::string &filename) void MetaFileSystem::CloseFile(u32 handle) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); IFileSystem *sys = GetHandleOwner(handle); if (sys) sys->CloseFile(handle); @@ -463,7 +463,7 @@ void MetaFileSystem::CloseFile(u32 handle) size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); IFileSystem *sys = GetHandleOwner(handle); if (sys) return sys->ReadFile(handle,pointer,size); @@ -473,7 +473,7 @@ size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); IFileSystem *sys = GetHandleOwner(handle); if (sys) return sys->WriteFile(handle,pointer,size); @@ -483,7 +483,7 @@ size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size) size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); IFileSystem *sys = GetHandleOwner(handle); if (sys) return sys->SeekFile(handle,position,type); @@ -493,7 +493,7 @@ size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type) void MetaFileSystem::DoState(PointerWrap &p) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); auto s = p.Section("MetaFileSystem", 1); if (!s) diff --git a/src/core/file_sys/meta_file_system.h b/src/core/file_sys/meta_file_system.h index 961f75cda..f358d8d5c 100644 --- a/src/core/file_sys/meta_file_system.h +++ b/src/core/file_sys/meta_file_system.h @@ -104,7 +104,7 @@ public: // TODO: void IoCtl(...) void SetStartingDirectory(const std::string &dir) { - std::lock_guard<std::mutex> guard(lock); + std::lock_guard<std::recursive_mutex> guard(lock); startingDirectory = dir; } }; |