mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 17:23:40 +01:00
Fix folder browser on Android and Windows
This commit is contained in:
1 parent
49efa4499e
commit
b7350f3cbf
7 files changed
+54
-39
No files matched your search
@@ -16,19 +16,22 @@ const char *RequestTypeAsString(SystemRequestType type) {
|
||||
|
||||
bool RequestManager::MakeSystemRequest(SystemRequestType type, RequestCallback callback, const std::string ¶m1, const std::string ¶m2, int param3) {
|
||||
int requestId = idCounter_++;
|
||||
|
||||
// NOTE: We need to register immediately, in order to support synchronous implementations.
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(callbackMutex_);
|
||||
callbackMap_[requestId] = callback;
|
||||
}
|
||||
|
||||
INFO_LOG(SYSTEM, "Making system request %s: id %d, callback_valid %d", RequestTypeAsString(type), requestId, callback != nullptr);
|
||||
if (!System_MakeRequest(type, requestId, param1, param2, param3)) {
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(callbackMutex_);
|
||||
callbackMap_.erase(requestId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!callback) {
|
||||
// We don't expect a response, this is a one-directional request. We're thus done.
|
||||
return true;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> guard(callbackMutex_);
|
||||
INFO_LOG(SYSTEM, "Registering pending callback %d", requestId);
|
||||
callbackMap_[requestId] = callback;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user