mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 14:20:44 -04:00
added warning when deleting a thread that isnot finished
This commit is contained in:
parent
7b2541e35c
commit
1cee069243
2 changed files with 11 additions and 1 deletions
|
@ -103,6 +103,16 @@ RsThread::RsThread()
|
||||||
mShouldStopSemaphore.set(0) ;
|
mShouldStopSemaphore.set(0) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsThread::~RsThread()
|
||||||
|
{
|
||||||
|
if(isRunning())
|
||||||
|
{
|
||||||
|
std::cerr << "(EE) Deleting a thread that is actually running! Something is very wrong here:" << std::endl;
|
||||||
|
|
||||||
|
print_stacktrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool RsThread::isRunning()
|
bool RsThread::isRunning()
|
||||||
{
|
{
|
||||||
// do we need a mutex for this ?
|
// do we need a mutex for this ?
|
||||||
|
|
|
@ -243,7 +243,7 @@ class RsThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsThread();
|
RsThread();
|
||||||
virtual ~RsThread() {}
|
virtual ~RsThread() ;
|
||||||
|
|
||||||
void start(const std::string &threadName = "");
|
void start(const std::string &threadName = "");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue