add support for asynchronous execution in wxBase (patch 1906889)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1222,8 +1222,6 @@ bool wxHandleFatalExceptions(bool doit)
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
#ifdef __DARWIN__
|
||||
#include <sys/errno.h>
|
||||
#endif
|
||||
@@ -1246,17 +1244,17 @@ bool wxHandleFatalExceptions(bool doit)
|
||||
// need wxExecute-related helpers for them
|
||||
#if !USE_OLD_DARWIN_END_PROCESS_DETECT
|
||||
|
||||
bool wxGUIAppTraits::CreateEndProcessPipe(wxExecuteData& execData)
|
||||
bool wxAppTraits::CreateEndProcessPipe(wxExecuteData& execData)
|
||||
{
|
||||
return execData.pipeEndProcDetect.Create();
|
||||
}
|
||||
|
||||
bool wxGUIAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd)
|
||||
bool wxAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd)
|
||||
{
|
||||
return fd == (execData.pipeEndProcDetect)[wxPipe::Write];
|
||||
}
|
||||
|
||||
void wxGUIAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& execData)
|
||||
void wxAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& execData)
|
||||
{
|
||||
execData.pipeEndProcDetect.Detach(wxPipe::Write);
|
||||
execData.pipeEndProcDetect.Close();
|
||||
@@ -1264,26 +1262,28 @@ void wxGUIAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& execData)
|
||||
|
||||
#else // !Darwin
|
||||
|
||||
bool wxGUIAppTraits::CreateEndProcessPipe(wxExecuteData& WXUNUSED(execData))
|
||||
bool wxAppTraits::CreateEndProcessPipe(wxExecuteData& WXUNUSED(execData))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
wxGUIAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData),
|
||||
wxAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData),
|
||||
int WXUNUSED(fd))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
wxGUIAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData))
|
||||
wxAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData))
|
||||
{
|
||||
// nothing to do here, we don't use the pipe
|
||||
}
|
||||
|
||||
#endif // !Darwin/Darwin
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
|
||||
{
|
||||
wxEndProcessData *endProcData = new wxEndProcessData;
|
||||
@@ -1440,6 +1440,10 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
|
||||
}
|
||||
}
|
||||
|
||||
#endif //wxUSE_GUI
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
#ifdef wxHAS_GENERIC_PROCESS_CALLBACK
|
||||
struct wxEndProcessFDIOHandler : public wxFDIOHandler
|
||||
{
|
||||
@@ -1512,9 +1516,6 @@ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
|
||||
}
|
||||
#endif // wxHAS_GENERIC_PROCESS_CALLBACK
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
#if wxUSE_BASE
|
||||
|
||||
void wxHandleProcessTermination(wxEndProcessData *proc_data)
|
||||
{
|
||||
// notify user about termination if required
|
||||
|
Reference in New Issue
Block a user