ControllerInterface: Remove unused "force" parameter

I'm not sure when this nonsense of forcing locking the mutex when it's
already taken should have ever taken effect, but let's be thankful it
isn't now. That was a badly worded sentence.
This commit is contained in:
Jasper St. Pierre 2014-11-13 00:10:02 -08:00
parent 6aa1a59ee8
commit b5d4e8d37e
2 changed files with 6 additions and 10 deletions

View File

@ -135,13 +135,11 @@ void ControllerInterface::Shutdown()
// //
// Update input for all devices, return true if all devices returned successful // Update input for all devices, return true if all devices returned successful
// //
bool ControllerInterface::UpdateInput(const bool force) bool ControllerInterface::UpdateInput()
{ {
std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock); std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock);
if (force) if (!lk.try_lock())
lk.lock();
else if (!lk.try_lock())
return false; return false;
size_t ok_count = 0; size_t ok_count = 0;
@ -163,13 +161,11 @@ bool ControllerInterface::UpdateInput(const bool force)
// //
// Update output for all devices, return true if all devices returned successful // Update output for all devices, return true if all devices returned successful
// //
bool ControllerInterface::UpdateOutput(const bool force) bool ControllerInterface::UpdateOutput()
{ {
std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock); std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock);
if (force) if (!lk.try_lock())
lk.lock();
else if (!lk.try_lock())
return false; return false;
size_t ok_count = 0; size_t ok_count = 0;

View File

@ -120,8 +120,8 @@ public:
bool IsInit() const { return m_is_init; } bool IsInit() const { return m_is_init; }
void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const; void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const;
bool UpdateInput(const bool force = false); bool UpdateInput();
bool UpdateOutput(const bool force = false); bool UpdateOutput();
std::recursive_mutex update_lock; std::recursive_mutex update_lock;