mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Generate a fatal error if a running Thread object is destroyed
This commit is contained in:
2
TODO.txt
2
TODO.txt
@@ -4,8 +4,6 @@ BEAST TODO
|
||||
|
||||
- add expectThrow() to UnitTest, where it expects an exception
|
||||
|
||||
- Remove timeout forced-kill from Thread::stopThread ()
|
||||
|
||||
- Import secp256k1 from sipa
|
||||
|
||||
- HashMap work:
|
||||
|
||||
@@ -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