Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RS232Timer::RS232Timer()
- {
- m_hThreadEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
- m_hThreadControlEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
- m_bThreadActive = false;
- m_bRunThread = false;
- }
- void RS232Timer::startThread()
- {
- m_bRunThread = true;
- (void)ResetEvent(m_hThreadEvent);
- (void)ResetEvent(m_hThreadControlEvent);
- (void)AfxBeginThread(timeoutThread,(void*)this); //timeoutThread is another function
- if((waitForSingleObject(m_hThreadControlEvent,1500)!=WAIT_OBJECT_O)||!m_bThreadActive)
- {
- assert(FALSE);
- m_bThread = false;
- }
- }
Add Comment
Please, Sign In to add comment