824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
|
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
|
-
+
|
ConsoleOutputProc(
ClientData instanceData, /* Console state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCode) /* Where to store error code. */
{
ConsoleInfo *infoPtr = instanceData;
ConsoleThreadInfo *threadInfo = &infoPtr->reader;
ConsoleThreadInfo *threadInfo = &infoPtr->writer;
DWORD bytesWritten, timeout;
*errorCode = 0;
timeout = (infoPtr->flags & CONSOLE_ASYNC) ? 0 : INFINITE;
if (WaitForSingleObject(threadInfo->readyEvent,timeout) == WAIT_TIMEOUT) {
/*
* The writer thread is blocked waiting for a write to complete and
|