Make gui panic alerts thread safe in linux.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6375 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-11-11 00:55:06 +00:00
parent 072a698856
commit 5078f430c3
4 changed files with 35 additions and 3 deletions

View File

@ -452,9 +452,23 @@ void Host_SysMessage(const char *fmt, ...)
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
{
return wxYES == wxMessageBox(wxString::FromAscii(text),
wxString::FromAscii(caption),
(yes_no)?wxYES_NO:wxOK);
#ifdef __WXGTK__
if (wxIsMainThread())
#endif
return wxYES == wxMessageBox(wxString::FromAscii(text),
wxString::FromAscii(caption),
(yes_no) ? wxYES_NO : wxOK);
#ifdef __WXGTK__
else
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC);
event.SetString(wxString::FromAscii(text));
event.SetInt(yes_no);
main_frame->GetEventHandler()->AddPendingEvent(event);
main_frame->panic_event.Wait();
return main_frame->bPanicResult;
}
#endif
}
// Accessor for the main window class