mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-06 04:33:49 +01:00
Make the Loader API thread-safe
Since the majority of the code is using ReadAt API already, map this to a `readp` "syscall" which does not mutate any state about the file descriptor therefore making it fairly safe multi-threading wise. This allows to get rid of read-time mutexes in RamCachedFileLoader and therefore fixes #9803
This commit is contained in:
1 parent
3249d81654
commit
3c3596dbf2
14 files changed
+7
-107
No files matched your search
@@ -38,7 +38,6 @@ BlockDevice *constructBlockDevice(FileLoader *fileLoader) {
|
||||
return nullptr;
|
||||
char buffer[4]{};
|
||||
size_t size = fileLoader->ReadAt(0, 1, 4, buffer);
|
||||
fileLoader->Seek(0);
|
||||
if (size == 4 && !memcmp(buffer, "CISO", 4))
|
||||
return new CISOFileBlockDevice(fileLoader);
|
||||
else if (size == 4 && !memcmp(buffer, "\x00PBP", 4))
|
||||
|
||||
Reference in new issue
Block a user