- LASSERT(i == MAX_PIPES, /**/);
- if (!success || status != writebuf_.length()) {
- resetPipe(i);
- continue;
+ LASSERT(is_outpipe, /**/);
+ // Let's see whether we have a reply
+ if (!outbuf_.empty()) {
+ // Yep. Deliver it to all pipe
+ // instances if we get ownership
+ // of the mutex, otherwise we'll
+ // try again the next round.
+ DWORD result = WaitForSingleObject(
+ outbuf_mutex_, 200);
+ if (result == WAIT_OBJECT_0) {
+ DWORD j = MAX_CLIENTS;
+ while (j < MAX_PIPES) {
+ pipe_[j].iobuf = outbuf_;
+ ++j;
+ }
+ outbuf_.erase();
+ }
+ ReleaseMutex(outbuf_mutex_);