Skip to content

Commit

Permalink
Win32: use isolated execution context instead of bare thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Jan 6, 2025
1 parent 00172a7 commit 21a4ad1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/crystal/system/win32/file_descriptor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,11 @@ private module ConsoleUtils
@@read_requests = Deque(ReadRequest).new
@@bytes_read = Deque(Int32).new
@@mtx = ::Thread::Mutex.new
@@reader_thread = ::Thread.new { reader_loop }
{% if flag?(:execution_context) %}
@@reader_thread = ExecutionContext.new("READER-LOOP") { reader_loop }
{% else %}
@@reader_thread = ::Thread.new { reader_loop }
{% end %}

private def self.reader_loop
while true
Expand Down

0 comments on commit 21a4ad1

Please sign in to comment.