| 发表于:2007-02-12 10:16:34 楼主 |
//thread a ncontinue = 1; cwinthread* pthread = afxbeginthead(threadfunc,&ncontinue); . ... .... ncontinue = 0; //tell thread b to terminate //thread b uint threadfunc (lpvoid pparam) { int * pcontinue =(int *)pparam; while (* pcontinue) { //work work work } return 0; } 我的问题是:线程b如何检查ncontinue,我知道当ncontinue == 0 的时候线程结束线程b,那么当ncontinue == 0成立的时候,线程b又是怎么样结束的呢? 感觉书上给出的这个例程就像天马行空一样。摸不着边际! |
|
|
|
|