Original Post
I have a socket read thread. I would like to be able just to wait for a stop signal to end the thread. However, I have to loop and check an event. while(bRun == true) { //check event status EventState = WaitForMultipleObjects(2, Events, FALSE,INFINITE); switch(EventState) { case WAIT_OBJECT_0: //stop event bRun = false; break; case (WAIT_OBJECT_0 + 1): //read on FD_ZERO(&fdset); FD_SET(Socket, &fdset); if(select(1, &fdset, NULL, NULL, &conn_timeout) > 0) { //read data.............. } break; } } I remember in UNIX you could wait for a signal at the select statement which worked in similar way to WaitForEvent. I want to wait at the select statement in an indefinite time instead of timing out and polling again when there is no activity. Thanks.