ParseOpts::Opts opts = { 0 };
ParseOpts PO;
+ BOOL bQuit = FALSE;
opts.cMinCalls = 1;
opts.cMaxCalls = 20;
threadStatus = _beginthread(receiveLoop, 0, (void*)&rpcargs);
/* We handle the queue entries here. Work loop: */
- while (TRUE) {
+ while (!bQuit) {
worklist_wait();
while (!worklist_isEmpty()) {
k5_ipc_stream buf = NULL;
ccs_pipe_t pipe2 = NULL;
if (worklist_remove(&rpcmsg, &pipe, &buf, &serverStartTime)) {
+ if (rpcmsg == CCMSG_QUIT) {
+ bQuit = TRUE;
+ break;
+ }
uuid = ccs_win_pipe_getUuid(pipe);
#if 0
cci_debug_printf("%s: processing WorkItem msg:%ld pipeUUID:<%s> pipeHandle:0x%X SST:%ld",
free_alloc_p(&endpoint);
}
+ // tell main thread to shutdown since it won't receive any more messages
+ worklist_add(CCMSG_QUIT, NULL, NULL, 0);
_endthread();
} // End receiveLoop