summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-12-29 20:17:04 +0100
committerGitHub <noreply@github.com>2023-12-29 20:17:04 +0100
commit99fbc4b97ecc21c82a8cde602af1bf3b47a186d2 (patch)
treec42b16871bed955e337895a8d3c42ee17cf164c8 /Source/Core/InputCommon/ControllerInterface/CoreDevice.h
parentbf0ac9de0ccf004b86ccadd0a0212fc6804d7600 (diff)
parente456bef163c1b667ff5a045a4bda66b30326ae90 (diff)
Merge pull request #11885 from Filoppi/devices_deadlock_fix_v2
Input: Improve Controller Interface devices threading
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/CoreDevice.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
index a2176637ab..1667b42a00 100644
--- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
@@ -36,6 +36,12 @@ constexpr ControlState BATTERY_INPUT_MAX_VALUE = 100.0;
namespace Core
{
+enum class DeviceRemoval
+{
+ Remove,
+ Keep,
+};
+
class Device
{
public:
@@ -118,7 +124,7 @@ public:
virtual std::string GetName() const = 0;
virtual std::string GetSource() const = 0;
std::string GetQualifiedName() const;
- virtual void UpdateInput() {}
+ virtual DeviceRemoval UpdateInput() { return DeviceRemoval::Keep; }
// May be overridden to implement hotplug removal.
// Currently handled on a per-backend basis but this could change.
@@ -242,7 +248,8 @@ public:
std::recursive_mutex& GetDevicesMutex() const { return m_devices_mutex; }
protected:
- // Exclusively needed when reading/writing "m_devices"
+ // Exclusively needed when reading/writing the "m_devices" array.
+ // Not needed when individually readring/writing a single device ptr.
mutable std::recursive_mutex m_devices_mutex;
std::vector<std::shared_ptr<Device>> m_devices;
};