mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 21:15:58 +00:00
Consolidate Process::terminate code
This commit is contained in:
@@ -57,12 +57,6 @@ void Process::setPriority (ProcessPriority prior)
|
|||||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::terminate()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
exit (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
|
|||||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::terminate()
|
|
||||||
{
|
|
||||||
// http://www.unix.com/man-page/FreeBSD/2/_exit/
|
|
||||||
::_exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||||
{
|
{
|
||||||
// XXX not implemented for FreeBSD!
|
// XXX not implemented for FreeBSD!
|
||||||
|
|||||||
@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
|
|||||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::terminate()
|
|
||||||
{
|
|
||||||
// http://linux.die.net/man/2/_exit
|
|
||||||
::_exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||||
{
|
{
|
||||||
static char testResult = 0;
|
static char testResult = 0;
|
||||||
|
|||||||
@@ -53,12 +53,6 @@ void Process::lowerPrivilege()
|
|||||||
bassertfalse;
|
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)
|
void Process::setPriority (ProcessPriority)
|
||||||
{
|
{
|
||||||
// xxx
|
// xxx
|
||||||
|
|||||||
@@ -148,6 +148,15 @@ void BEAST_CALLTYPE Thread::sleep (int millisecs)
|
|||||||
nanosleep (&time, nullptr);
|
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 = '/';
|
const beast_wchar File::separator = '/';
|
||||||
|
|||||||
Reference in New Issue
Block a user