I'm trying to use class Thread from the IceUtils.dll and when i create a new thread i'm always getting an unhandled exception. The situation is like this:
class CReaderThread : public IceUtil::Thread
{
void run() { }
}
class CWriterThread : public IceUtil::Thread
{
void Start() {
_ThreadB = new CReaderThread();
this->start();
}
void Stop() {
//Stop _ThreadB
_ThreadB.getThreadControl().join();
//Stop this (class WriterThread)
}
CReaderThreadPtr _ThreadB;
}
The issue is that when i call the CWriterThread Start method for the first time the 2 threads start normally. Then i call the Stop function and everything is OK. But if i call for a second time the Start method of the CWriteThread the i get an exception on the line that creates the _ThreadB = new CReaderThread().
If i comment out the line: this->start();,
then i can call the Start and Stop methods as many times as i want.
Maybe i have misunderstood something in the way that i should be using the IceUtil::Thread class.
DT

Reply With Quote
