E
Erazem Polutnik
Hello,
i have a strange problem, when calling virtual function, using SDL Thread
library. Here is situation:
CThread::CThread
{
SDL_CreateThread(RunProc,this);
}
virtual bool CThread::IsRunning()
{
return false;
}
int SDLCALL CThread::RunProc(void *pParam)
{
/*delay 100ms*/
CThread *pt=(CThread *)pParam;
while (pt->IsRunning()) {
pt->DoRun();
}
}
then I make:
class CMyThread : public CThread
{
virtual bool IsRunning()
{
return true;
}
};
After new CMyThread() I expect to function IsRunning to return true, but it
returns false as in CThread class
If I add 100ms delay everthing is working ok.
Many thanks
Erazem
i have a strange problem, when calling virtual function, using SDL Thread
library. Here is situation:
CThread::CThread
{
SDL_CreateThread(RunProc,this);
}
virtual bool CThread::IsRunning()
{
return false;
}
int SDLCALL CThread::RunProc(void *pParam)
{
/*delay 100ms*/
CThread *pt=(CThread *)pParam;
while (pt->IsRunning()) {
pt->DoRun();
}
}
then I make:
class CMyThread : public CThread
{
virtual bool IsRunning()
{
return true;
}
};
After new CMyThread() I expect to function IsRunning to return true, but it
returns false as in CThread class
If I add 100ms delay everthing is working ok.
Many thanks
Erazem