mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: Remove unused/incomplete stuck/wait for thread dialogs
This commit is contained in:
parent
448ca97d93
commit
fb174b482f
|
@ -271,7 +271,6 @@ set(pcsx2GuiSources
|
|||
gui/Dialogs/LogOptionsDialog.cpp
|
||||
gui/Dialogs/McdConfigDialog.cpp
|
||||
gui/Dialogs/PickUserModeDialog.cpp
|
||||
gui/Dialogs/StuckThreadDialog.cpp
|
||||
gui/Dialogs/SysConfigDialog.cpp
|
||||
gui/Debugger/BreakpointWindow.cpp
|
||||
gui/Debugger/CtrlDisassemblyView.cpp
|
||||
|
|
|
@ -104,41 +104,6 @@ namespace Dialogs
|
|||
AssertionDialog( const wxString& text, const wxString& stacktrace );
|
||||
virtual ~AssertionDialog() throw() {}
|
||||
};
|
||||
|
||||
// There are two types of stuck threads:
|
||||
// * Threads stuck on any action that is not a cancellation.
|
||||
// * Threads stuck trying to cancel.
|
||||
//
|
||||
// The former means we can provide a "cancel" action for the user, which would itself
|
||||
// open a new dialog in the latter category. The latter means that there's really nothing
|
||||
// we can do, since pthreads API provides no good way for killing threads. The only
|
||||
// valid options for the user in that case is to either wait (boring!) or kill the
|
||||
// process (awesome!).
|
||||
|
||||
enum StuckThreadActionType
|
||||
{
|
||||
// Allows the user to attempt a cancellation of a stuck thread. This should only be
|
||||
// used on threads which are not already stuck during a cancellation action (ie, suspension
|
||||
// or other job requests). Also, if the running thread is known to not have any
|
||||
// cancellation points then this shouldn't be used either.
|
||||
StacT_TryCancel,
|
||||
|
||||
// Allows the user to kill the entire process for a stuck thread. Use this for any
|
||||
// thread which has failed to cancel in a reasonable timeframe, or for any stuck action
|
||||
// if the thread is known to have no cancellation points.
|
||||
StacT_KillProcess,
|
||||
};
|
||||
|
||||
class StuckThreadDialog : public wxDialogWithHelpers,
|
||||
public EventListener_Thread
|
||||
{
|
||||
public:
|
||||
StuckThreadDialog( wxWindow* parent, StuckThreadActionType action, Threading::pxThread& stuck_thread );
|
||||
virtual ~StuckThreadDialog() throw() {}
|
||||
|
||||
protected:
|
||||
void OnThreadCleanup();
|
||||
};
|
||||
}
|
||||
|
||||
wxWindowID pxIssueConfirmation( wxDialogWithHelpers& confirmDlg, const MsgButtons& buttons );
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/* PCSX2 - PS2 Emulator for PCs
|
||||
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
||||
*
|
||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with PCSX2.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "App.h"
|
||||
#include "Dialogs/ModalPopups.h"
|
||||
|
||||
using namespace pxSizerFlags;
|
||||
using namespace Threading;
|
||||
|
||||
// NOTE: Currently unused module. Stuck Threads are not detected or handled at this time,
|
||||
// though I would like to have something in place in the distant future. --air
|
||||
|
||||
|
||||
Dialogs::StuckThreadDialog::StuckThreadDialog( wxWindow* parent, StuckThreadActionType action, pxThread& stuck_thread )
|
||||
: wxDialogWithHelpers( parent, _("PCSX2 Thread is not responding") )
|
||||
{
|
||||
stuck_thread.AddListener( this );
|
||||
|
||||
*this += Heading( wxsFormat(
|
||||
pxE( L"The thread '%s' is not responding. It could be deadlocked, or it might just be running *really* slowly."
|
||||
),
|
||||
stuck_thread.GetName().data()
|
||||
) );
|
||||
|
||||
|
||||
*this += Heading(
|
||||
L"\nDo you want to stop the program [Yes/No]?"
|
||||
L"\nOr press [Ignore] to suppress further assertions."
|
||||
);
|
||||
|
||||
*this += new ModalButtonPanel( this, MsgButtons().Cancel().Custom(L"Wait", "wait") ) | StdCenter();
|
||||
|
||||
if( wxWindow* idyes = FindWindowById( wxID_YES ) )
|
||||
idyes->SetFocus();
|
||||
}
|
||||
|
||||
void Dialogs::StuckThreadDialog::OnThreadCleanup()
|
||||
{
|
||||
}
|
|
@ -391,64 +391,6 @@ void pxEvtQueue::SetActiveThread()
|
|||
m_OwnerThreadId = wxThread::GetCurrentId();
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// WaitingForThreadedTaskDialog
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Note: currently unused (legacy code). May be utilized at a later date, so I'm leaving
|
||||
// it in (for now!)
|
||||
//
|
||||
class WaitingForThreadedTaskDialog
|
||||
: public wxDialogWithHelpers
|
||||
{
|
||||
private:
|
||||
typedef wxDialogWithHelpers _parent;
|
||||
|
||||
protected:
|
||||
pxThread* m_thread;
|
||||
|
||||
public:
|
||||
WaitingForThreadedTaskDialog( pxThread* thr, wxWindow* parent, const wxString& title, const wxString& content );
|
||||
virtual ~WaitingForThreadedTaskDialog() throw() {}
|
||||
|
||||
protected:
|
||||
void OnCancel_Clicked( wxCommandEvent& evt );
|
||||
void OnTerminateApp_Clicked( wxCommandEvent& evt );
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// WaitingForThreadedTaskDialog Implementations
|
||||
// --------------------------------------------------------------------------------------
|
||||
WaitingForThreadedTaskDialog::WaitingForThreadedTaskDialog( pxThread* thr, wxWindow* parent, const wxString& title, const wxString& content )
|
||||
: wxDialogWithHelpers( parent, title )
|
||||
{
|
||||
SetMinWidth( 500 );
|
||||
|
||||
m_thread = thr;
|
||||
|
||||
*this += Text( content ) | StdExpand();
|
||||
*this += 15;
|
||||
*this += Heading(_("Press Cancel to attempt to cancel the action."));
|
||||
*this += Heading(AddAppName(_("Press Terminate to kill %s immediately.")));
|
||||
|
||||
*this += new wxButton( this, wxID_CANCEL );
|
||||
*this += new wxButton( this, wxID_ANY, _("Terminate App") );
|
||||
}
|
||||
|
||||
void WaitingForThreadedTaskDialog::OnCancel_Clicked( wxCommandEvent& evt )
|
||||
{
|
||||
evt.Skip();
|
||||
if( !m_thread ) return;
|
||||
m_thread->Cancel( false );
|
||||
|
||||
if( wxWindow* cancel = FindWindowById( wxID_CANCEL ) ) cancel->Disable();
|
||||
}
|
||||
|
||||
void WaitingForThreadedTaskDialog::OnTerminateApp_Clicked( wxCommandEvent& evt )
|
||||
{
|
||||
// (note: SIGTERM is a "handled" kill that performs shutdown stuff, which typically just crashes anyway)
|
||||
wxKill( wxGetProcessId(), wxSIGKILL );
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// ExecutorThread Implementations
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
|
|
@ -381,7 +381,6 @@
|
|||
<ClCompile Include="..\..\gui\Dialogs\ImportSettingsDialog.cpp" />
|
||||
<ClCompile Include="..\..\gui\Dialogs\LogOptionsDialog.cpp" />
|
||||
<ClCompile Include="..\..\gui\Dialogs\PickUserModeDialog.cpp" />
|
||||
<ClCompile Include="..\..\gui\Dialogs\StuckThreadDialog.cpp" />
|
||||
<ClCompile Include="..\..\gui\Dialogs\SysConfigDialog.cpp" />
|
||||
<ClCompile Include="..\..\gui\Panels\AudioPanel.cpp" />
|
||||
<ClCompile Include="..\..\gui\Panels\BaseApplicableConfigPanel.cpp" />
|
||||
|
|
|
@ -677,9 +677,6 @@
|
|||
<ClCompile Include="..\..\gui\Dialogs\PickUserModeDialog.cpp">
|
||||
<Filter>AppHost\Dialogs</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gui\Dialogs\StuckThreadDialog.cpp">
|
||||
<Filter>AppHost\Dialogs</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gui\Dialogs\SysConfigDialog.cpp">
|
||||
<Filter>AppHost\Dialogs</Filter>
|
||||
</ClCompile>
|
||||
|
|
Loading…
Reference in New Issue