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 Dec 20, 2024
1 parent 45329a6 commit 1831886
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,12 @@ private module ConsoleUtils
@@read_requests = Deque(ReadRequest).new
@@bytes_read = Deque(Int32).new
@@mtx = ::Thread::Mutex.new
@@reader_thread = ::Thread.new { reader_loop }
@@reader_thread =
{% if flag?(:execution_context) %}
ExecutionContext.new("READER-LOOP") { reader_loop }
{% else %}
::Thread.new { reader_loop }
{% end %}

private def self.reader_loop
while true
Expand Down

0 comments on commit 1831886

Please sign in to comment.