首先在VC中暂停程序,看看线程是没有结束,还是结束了waitfor没有反应。如果是前者,有可能由于优化有while(!end)时没有每次读取end的值,在end的声明前加上volatile,这个关键字就是这时候用的。 The volatile keyword is a type qualifier used to declare that an object can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread。可以参看MSDN。如果是后者,可能是没有设置CWinThread::m_bAutoDelete,可以参看http://community.csdn.net/Expert/TopicView.asp?id=4676405
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货