mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 19:58:36 +01:00
Avoid spamming the keymap lock during input processing
This commit is contained in:
1 parent
ac208505a5
commit
16a31c2554
3 files changed
+42
-11
No files matched your search
+15
-2
@@ -524,8 +524,8 @@ bool InputMappingToPspButton(const InputMapping &mapping, std::vector<int> *pspB
|
||||
return found;
|
||||
}
|
||||
|
||||
bool InputMappingsFromPspButton(int btn, std::vector<MultiInputMapping> *mappings, bool ignoreMouse) {
|
||||
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
|
||||
// This is the main workhorse of the ControlMapper.
|
||||
bool InputMappingsFromPspButtonNoLock(int btn, std::vector<MultiInputMapping> *mappings, bool ignoreMouse) {
|
||||
auto iter = g_controllerMap.find(btn);
|
||||
if (iter == g_controllerMap.end()) {
|
||||
return false;
|
||||
@@ -542,6 +542,19 @@ bool InputMappingsFromPspButton(int btn, std::vector<MultiInputMapping> *mapping
|
||||
return mapped;
|
||||
}
|
||||
|
||||
bool InputMappingsFromPspButton(int btn, std::vector<MultiInputMapping> *mappings, bool ignoreMouse) {
|
||||
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
|
||||
return InputMappingsFromPspButtonNoLock(btn, mappings, ignoreMouse);
|
||||
}
|
||||
|
||||
void LockMappings() {
|
||||
g_controllerMapLock.lock();
|
||||
}
|
||||
|
||||
void UnlockMappings() {
|
||||
g_controllerMapLock.unlock();
|
||||
}
|
||||
|
||||
bool PspButtonHasMappings(int btn) {
|
||||
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
|
||||
auto iter = g_controllerMap.find(btn);
|
||||
|
||||
Reference in new issue
Block a user