是否在类中无法创建线程呢?
如下代码,Producer函数似乎无法执行.
/////DWORD WINAPI Producer(LPVOID lpParameter)
BOOL CMy1111Dlg::OnInitDialog()//无法在类内创建线程???
{
CDialog::OnInitDialog();
//////////////////////////////////////////////////////////////////
CreateThread(NULL,0,Producer,(void*)this,0,NULL);
CreateThread(NULL,0,Producer,(void*)this,0,NULL);
CreateThread(NULL,0,Consumer,(void*)this,0,NULL);
Empty = CreateSemaphore(NULL,N,N,NULL);
Full = CreateSemaphore(NULL,0,N,NULL);
Mutex = CreateMutex(NULL,FALSE,NULL);
// CloseHandle(Mutex);
///////////////////////////////////////////////////////////////////
return TRUE;
}