mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Generate a fatal error if a running Thread object is destroyed
This commit is contained in:
@@ -42,7 +42,8 @@ Thread::~Thread()
|
||||
*/
|
||||
bassert (! isThreadRunning());
|
||||
|
||||
stopThread (100);
|
||||
if (isThreadRunning())
|
||||
FatalError ("Thread is still running", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -56,10 +56,7 @@ public:
|
||||
|
||||
/** Destructor.
|
||||
|
||||
Deleting a Thread object that is running will only give the thread a
|
||||
brief opportunity to stop itself cleanly, so it's recommended that you
|
||||
should always call stopThread() with a decent timeout before deleting,
|
||||
to avoid the thread being forcibly killed (which is a Bad Thing).
|
||||
If the thread has not been stopped first, this will generate a fatal error.
|
||||
*/
|
||||
virtual ~Thread();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user