07.03.2013 Views

Multithreading Multi-Threaded Programming

Multithreading Multi-Threaded Programming

Multithreading Multi-Threaded Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Another Timer Thread Function<br />

//a timer for 5 seconds<br />

UINT Timer5s( LPVOID pParam )<br />

{<br />

int timeInterval = 5000; // five seconds<br />

int iRet = WaitForSingleObject( g_hAbortEvent, timeInterval );<br />

Switch(iRet)<br />

{<br />

case WAIT_OBJECT_0: break;<br />

case WAIT_TIMEOUT:<br />

g_hTimeoutEvent. SetEvent(); //Signal timeout<br />

break;<br />

}<br />

}<br />

36<br />

return iRet;<br />

Advanced Windows Network <strong>Programming</strong><br />

11/11/12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!