mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 11:15:56 +00:00
Add Thread::stopThreadAsync
This commit is contained in:
@@ -208,6 +208,17 @@ bool Thread::stopThread (const int timeOutMilliseconds)
|
||||
return cleanExit;
|
||||
}
|
||||
|
||||
void Thread::stopThreadAsync ()
|
||||
{
|
||||
const ScopedLock sl (startStopLock);
|
||||
|
||||
if (isThreadRunning())
|
||||
{
|
||||
signalThreadShouldExit();
|
||||
notify();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool Thread::setPriority (const int newPriority)
|
||||
{
|
||||
|
||||
@@ -110,6 +110,11 @@ public:
|
||||
*/
|
||||
bool stopThread (int timeOutMilliseconds = -1);
|
||||
|
||||
/** Stop the thread without blocking.
|
||||
This calls signalThreadShouldExit followed by notify.
|
||||
*/
|
||||
void stopThreadAsync ();
|
||||
|
||||
//==============================================================================
|
||||
/** Returns true if the thread is currently active */
|
||||
bool isThreadRunning() const;
|
||||
|
||||
Reference in New Issue
Block a user