Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/crystal/system/win32/file_descriptor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ private module ConsoleUtils
@@read_requests = Deque(ReadRequest).new
@@bytes_read = Deque(Int32).new
@@mtx = ::Thread::Mutex.new
{% if flag?(:execution_context) %}
@@reader_thread = ::Fiber::ExecutionContext::Isolated.new("READER-LOOP") { reader_loop }
{% else %}
@@reader_thread = ::Thread.new { reader_loop }
{% end %}

# Start a dedicated thread to block on reads from the console. Doesn't need an
# isolated execution context because there's no fiber communication (only
# thread communication) and only blocking I/O within the thread.
@@reader_thread = ::Thread.new { reader_loop }

private def self.reader_loop
while true
Expand Down