I did something like this, it works fine but is this the right way of doing ??
void ThinThread ::run ()
{
label:
while(suspFlag)
{
sleep(1);
cout <<" in the thread "<< endl;
}
if (!suspFlag)
{
while (!suspFlag)
{
sleep(1);
}
}
goto label;
cout <<"done with the thread\n";
}
void ThinThread::suspend()
{
suspFlag=false;
}
void ThinThread::resume()
{
suspFlag=true;
}
void ThinThread ::run ()
{
label:
while(suspFlag)
{
sleep(1);
cout <<" in the thread "<< endl;
}
if (!suspFlag)
{
while (!suspFlag)
{
sleep(1);
}
}
goto label;
cout <<"done with the thread\n";
}
void ThinThread::suspend()
{
suspFlag=false;
}
void ThinThread::resume()
{
suspFlag=true;
}
To copy to clipboard, switch view to plain text mode
please suggest me on this 
Thanks in advance,
Boss
Bookmarks