Good morning
I
wxThread::Delete() problem Topic is solved
Hi Jenrique,
Are you calling the TestDestroy() function within your thread code from time to time to check if the thread should exit?
If you don't do so then Delete() will wait that the thread exit by itself.
Best regards,
Lall
Are you calling the TestDestroy() function within your thread code from time to time to check if the thread should exit?
If you don't do so then Delete() will wait that the thread exit by itself.
Best regards,
Lall
-----------------------------------
Lall
http://www.axoris.be
Axoris - Sound makes music
-----------------------------------
Lall
http://www.axoris.be
Axoris - Sound makes music
-----------------------------------
Yes, sure, this is the function on my thread:
I think it
Code: Select all
void* CPorthread::Entry()
{
InitializePortThread();
bool bReadOk = false;
int nReadWrong = 0;
while(true)
{
if ( TestDestroy() )
{
break;
}
bReadOk = ReadPort();
m_pCritSect->Enter();
m_pProcessPort->m_bReadOk = bReadOk;
m_pCritSect->Leave();
if( bReadOk )
{
nReadWrong = 0;
}else{
nReadWrong ++;
}
if( nReadWrong > 3000 )
{
break;
}
}
return NULL;
}
[quote="jenrique"]Yes, sure, this is the function on my thread:
I think it
Code: Select all
void* CPorthread::Entry()
{
InitializePortThread();
bool bReadOk = false;
int nReadWrong = 0;
while(true)
{
if ( TestDestroy() )
{
break;
}
bReadOk = ReadPort();
m_pCritSect->Enter();
m_pProcessPort->m_bReadOk = bReadOk;
m_pCritSect->Leave();
if( bReadOk )
{
nReadWrong = 0;
}else{
nReadWrong ++;
}
if( nReadWrong > 3000 )
{
break;
}
}
return NULL;
}