Consolidate Process::terminate code

This commit is contained in:
Vinnie Falco
2013-08-14 09:40:01 -07:00
parent 377c983ecb
commit 5e5b49d4e2
5 changed files with 9 additions and 24 deletions

View File

@@ -57,12 +57,6 @@ void Process::setPriority (ProcessPriority prior)
pthread_setschedparam (pthread_self(), policy, &param);
}
void Process::terminate()
{
// TODO
exit (0);
}
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
{
return false;

View File

@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
pthread_setschedparam (pthread_self(), policy, &param);
}
void Process::terminate()
{
// http://www.unix.com/man-page/FreeBSD/2/_exit/
::_exit (EXIT_FAILURE);
}
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
{
// XXX not implemented for FreeBSD!

View File

@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
pthread_setschedparam (pthread_self(), policy, &param);
}
void Process::terminate()
{
// http://linux.die.net/man/2/_exit
::_exit (EXIT_FAILURE);
}
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
{
static char testResult = 0;

View File

@@ -53,12 +53,6 @@ void Process::lowerPrivilege()
bassertfalse;
}
void Process::terminate()
{
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/_exit.2.html
::_exit(EXIT_FAILURE);
}
void Process::setPriority (ProcessPriority)
{
// xxx

View File

@@ -148,6 +148,15 @@ void BEAST_CALLTYPE Thread::sleep (int millisecs)
nanosleep (&time, nullptr);
}
void Process::terminate()
{
#if BEAST_ANDROID || BEAST_BSD
// http://www.unix.com/man-page/FreeBSD/2/_exit/
::_exit (EXIT_FAILURE);
#else
std::_Exit (EXIT_FAILURE);
#endif
}
//==============================================================================
const beast_wchar File::separator = '/';