[CLI] Fixed: Frozen console input to the debugging application. (Windows only)
authorOleg Lekarev <o.lekarev@samsung.com>
Thu, 9 Dec 2021 14:14:49 +0000 (17:14 +0300)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Thu, 9 Dec 2021 17:17:52 +0000 (20:17 +0300)
src/utils/ioredirect.cpp
src/windows/iosystem_win32.cpp

index 3705dd2de867ae65046844be9651b5166b76e8dc..7ac5c3e47d343e2e6af2a7299b276dd7248a8c60 100644 (file)
@@ -408,7 +408,7 @@ IDebugger::AsyncResult IORedirectHelper::async_input(InStream& in)
         // NOTE: using here polling, but not waiting, on Win32,
         // to avoid issue with blocking console read operation...
 #ifdef _WIN32
-        const std::chrono::milliseconds PollPeriod{100};
+        const std::chrono::milliseconds PollPeriod{1000};
 #else
         auto& PollPeriod = WaitForever;
 #endif
index 25bf7756aa319bae0fa0b12790f51d8ae51b541f..2d482c51abbf31d63c0f956851b6f2df345227e8 100644 (file)
@@ -423,10 +423,8 @@ bool Class::async_wait(IOSystem::AsyncHandleIterator begin, IOSystem::AsyncHandl
     }
 
     assert(n == count);
-    DWORD result;
-    do result = WaitForMultipleObjects(count, events, FALSE, DWORD(timeout.count()));
-    while (result == WAIT_TIMEOUT);
-    return result != WAIT_FAILED;
+    DWORD result = WaitForMultipleObjects(count, events, FALSE, DWORD(timeout.count()));
+    return result != WAIT_FAILED && result != WAIT_TIMEOUT;
 }
 
 Class::IOResult Class::async_cancel(AsyncHandle& h)