# HG changeset patch # User anatofuz # Date 1583140610 -32400 # Node ID 1fb6c09db515ffa25c500efe8f922974974a8532 # Parent 26ab43de365471132bed76bed9e9ae4d1f002e4f add cbc_consoleread2 diff -r 26ab43de3654 -r 1fb6c09db515 src/impl/ConsoleIO.cbc --- a/src/impl/ConsoleIO.cbc Mon Mar 02 16:17:24 2020 +0900 +++ b/src/impl/ConsoleIO.cbc Mon Mar 02 18:16:50 2020 +0900 @@ -80,8 +80,15 @@ } __code consoleread2(struct ConsoleIO* IO, struct inode* ip, __code next(...)) { - - goto next(...); + if (input.r == input.w) { // input is global variable + if (proc->killed) { + release(&input.lock); + ilock(ip); + goto next(-1); + } + goto cbc_sleep(&input.r, &input.lock, cbc_consoleread2); + } + goto IO->consoleread1(); }