int CProducerThread::Run() { CP_CDlg *pDlg; pDlg=(CP_CDlg*)m_pParentDlg; CSingleLock mutexLock(pDlg->m_pMutex); for(int i=0;i pDlg->m_pSemaphoreEmpty->Lock(); mutexLock.Lock(); pDlg->m_sBuf.Format("%0.10d",i); mutexLock.Unlock(); pDlg->m_pSemaphoreFull->Unlock(); } return CWinThread::Run(); } CConsumerThread::CConsumerThread(void *pParent) :m_pParent(pParent) { } int CConsumerThread::Run() { CP_CDlg *pDlg; pDlg=(CP_CDlg*)this->m_pParent; char*pBuf; |
正在阅读:VC++学习:用vc实现生产者消费者问题VC++学习:用vc实现生产者消费者问题
2004-02-14 09:34
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键