mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Replaced Common::CriticalSection with a std::mutex implementation. 64bit Windows builds now use SRWLocks and ConditionVariables(requires Vista/7, x64 builds will no longer work on Windows XP x64). Tell me if you hate that. Removed Common::EventEx. Common::Event now uses a std::condition_variable impl.(using ConditionVariables on Windows x64, Events on x86, or posix condition variables elsewhere). I experience slight speed improvements with these changes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7294 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -278,9 +278,8 @@ void GamepadPage::ClearAll(wxCommandEvent&)
|
||||
// no point in using the real ControllerInterface i guess
|
||||
ControllerInterface face;
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
controller->UpdateReferences(face);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -289,9 +288,8 @@ void GamepadPage::LoadDefaults(wxCommandEvent&)
|
||||
{
|
||||
controller->LoadDefaults(g_controller_interface);
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
controller->UpdateReferences(g_controller_interface);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -300,9 +298,8 @@ void ControlDialog::SetControl(wxCommandEvent&)
|
||||
{
|
||||
control_reference->expression = STR_FROM_WXSTR(textctrl->GetValue());
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -318,9 +315,8 @@ void GamepadPage::SetDevice(wxCommandEvent&)
|
||||
controller->UpdateDefaultDevice();
|
||||
|
||||
// update references
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
controller->UpdateReferences(g_controller_interface);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
}
|
||||
|
||||
void ControlDialog::SetDevice(wxCommandEvent&)
|
||||
@ -338,9 +334,8 @@ void ControlDialog::ClearControl(wxCommandEvent&)
|
||||
{
|
||||
control_reference->expression.clear();
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -363,9 +358,8 @@ void ControlDialog::SetSelectedControl(wxCommandEvent&)
|
||||
|
||||
control_reference->expression = STR_FROM_WXSTR(expr);
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -395,25 +389,22 @@ void ControlDialog::AppendControl(wxCommandEvent& event)
|
||||
|
||||
control_reference->expression = STR_FROM_WXSTR(expr);
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
void GamepadPage::AdjustSetting(wxCommandEvent& event)
|
||||
{
|
||||
m_plugin.controls_crit.Enter(); // enter / prolly fine not being here
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
((PadSetting*)((wxControl*)event.GetEventObject())->GetClientData())->UpdateValue();
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
}
|
||||
|
||||
void GamepadPage::AdjustControlOption(wxCommandEvent&)
|
||||
{
|
||||
m_plugin.controls_crit.Enter(); // enter / prolly fine not being here
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
m_control_dialog->control_reference->range = (ControlState)(m_control_dialog->range_slider->GetValue()) / SLIDER_TICK_COUNT;
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
}
|
||||
|
||||
void GamepadPage::ConfigControl(wxCommandEvent& event)
|
||||
@ -432,9 +423,8 @@ void GamepadPage::ClearControl(wxCommandEvent& event)
|
||||
btn->control_reference->expression.clear();
|
||||
btn->control_reference->range = 1.0f;
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
controller->UpdateReferences(g_controller_interface);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
// update changes
|
||||
UpdateGUI();
|
||||
@ -453,9 +443,8 @@ void ControlDialog::DetectControl(wxCommandEvent& event)
|
||||
// apparently, this makes the "waiting" text work on Linux
|
||||
wxTheApp->Yield();
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
ControllerInterface::Device::Control* const ctrl = control_reference->Detect(DETECT_WAIT_TIME, dev);
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
// if we got input, select it in the list
|
||||
if (ctrl)
|
||||
@ -478,7 +467,7 @@ void GamepadPage::DetectControl(wxCommandEvent& event)
|
||||
// apparently, this makes the "waiting" text work on Linux
|
||||
wxTheApp->Yield();
|
||||
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
ControllerInterface::Device::Control* const ctrl = btn->control_reference->Detect(DETECT_WAIT_TIME, dev);
|
||||
|
||||
// if we got input, update expression and reference
|
||||
@ -488,8 +477,6 @@ void GamepadPage::DetectControl(wxCommandEvent& event)
|
||||
g_controller_interface.UpdateReference(btn->control_reference, controller->default_device);
|
||||
}
|
||||
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
|
||||
btn->SetLabel(WXSTR_FROM_STR(btn->control_reference->expression));
|
||||
}
|
||||
}
|
||||
@ -597,10 +584,9 @@ void GamepadPage::LoadProfile(wxCommandEvent&)
|
||||
IniFile inifile;
|
||||
inifile.Load(fname);
|
||||
|
||||
m_plugin.controls_crit.Enter();
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
controller->LoadConfig(inifile.GetOrCreateSection("Profile"));
|
||||
controller->UpdateReferences(g_controller_interface);
|
||||
m_plugin.controls_crit.Leave();
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
@ -662,7 +648,7 @@ void InputConfigDialog::UpdateDeviceComboBox()
|
||||
|
||||
void GamepadPage::RefreshDevices(wxCommandEvent&)
|
||||
{
|
||||
m_plugin.controls_crit.Enter(); // enter
|
||||
std::lock_guard<std::mutex> lk(m_plugin.controls_lock);
|
||||
|
||||
// refresh devices
|
||||
g_controller_interface.Shutdown();
|
||||
@ -673,8 +659,6 @@ void GamepadPage::RefreshDevices(wxCommandEvent&)
|
||||
|
||||
// update device cbox
|
||||
m_config_dialog->UpdateDeviceComboBox();
|
||||
|
||||
m_plugin.controls_crit.Leave(); // leave
|
||||
}
|
||||
|
||||
ControlGroupBox::~ControlGroupBox()
|
||||
|
Reference in New Issue
Block a user