< Previous by Date | Date Index | Next by Date > |
< Previous in Thread | Thread Index | Next in Thread > |
Sleep(100);
myThread.shutdown();
DWORD counter = 0;
while (myThread.waitForShutdown(20) == false)
{
if (++counter >= 500) // Waiting the thread 10 seconds.
{
break;
}
}
myThread.detach();
cout << "After detach." << endl;
return 0;
}
int main()
{
MyThread myThread;
myThread.run();
Sleep(100);
myThread.shutdown();
while (myThread.waitForShutdown(200) == false)
{
}
myThread.detach();
cout << "After detach." << endl;
return 0;
}
Hmm. That thread isn't actually shut-down. ThreadIf::shutdown() just sets a sentinel value that will only take effect the next time the StackThread finishes cycling. The waitForShutdown() call used to function simply as a sleep() call; the fact that it took a while to return was the only thing allowing the cycle to complete before everything went out of scope. mShutdown is set, but mShutdown is just the sentinel value, and there is no guarantee whatsoever that it is being honored. I'll think about this more in the morning.
Best regards,Byron Campen
I'm using Visual C++ 8.0(Visual Studio 2005 with SP1 and SP1 for Vista Update), My OS is Vista+SP1.complied My applications and reSIProcate with MT and MTd mode, others are using default settings.Thanks
2008/3/30, Alan Hawrylyshen <alan@xxxxxxxxxxxx>:
On 29-Mar-08, at 20:05 , Karlsson wrote:
> Hi Alan, I'm sure, I use SVN to got all 1.3.0 source code to a new
> directory: reSIProcate13. The older reSIProcate in another
> directory: resiprocate122.
> I have complied the 1.3.0 RC1 completely, and My application linked
> these new header files and LIBs, I complied all reSIProcate module
> as MTd and MT .
> ...
I apologize if you have indicated this previously, but what platform
are you using, along with specific compiler and runtime library
details? (Windows, Linux, BSD, Mac OS) and what compiler, variant of
OS, etc...
Thanks,
Alan_______________________________________________resiprocate-devel mailing list