fix thread blocked by expeditor

original commit: fa7516efa7bee58b2a7307e504ed97fc3bc69731
This commit is contained in:
yjqww6 2016-06-11 00:49:25 +08:00
parent 35013d29fb
commit 6d7f4089e1

View File

@ -96,7 +96,18 @@ static ptr s_ee_read_char(IBOOL blockp) {
if (NumberOfEvents == 0) return Sfalse;
}
if (!ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead))
#ifdef PTHREADS
ptr tc = get_thread_context();
deactivate_thread(tc);
#endif
BOOL succ = ReadConsoleInput(hStdin, irInBuf, 1, &cNumRead);
#ifdef PTHREADS
reactivate_thread(tc);
#endif
if (!succ)
S_error1("expeditor", "error getting console info: ~a",
S_LastErrorString());