Skip to content

Commit

Permalink
fix building
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Jul 1, 2024
1 parent a6db2a4 commit 94352da
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions src/hacks.cr
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,18 @@ class Fiber
STDERR.flush
end
ensure
{% if flag?(:preview_mt) %}
Crystal::Scheduler.enqueue_free_stack @stack
{% elsif flag?(:interpreted) %}
# For interpreted mode we don't need a new stack, the stack is held by the interpreter
{% else %}
Fiber.stack_pool.release(@stack)
{% end %}

# Remove the current fiber from the linked list
Fiber.fibers.delete(self)

# Delete the resume event if it was used by `yield` or `sleep`
@resume_event.try &.free
@timeout_event.try &.free
@timeout_select_action = nil

@alive = false
Crystal::Scheduler.reschedule
Fiber.inactive(self)

# Delete the resume event if it was used by `yield` or `sleep`
@resume_event.try &.free
@timeout_event.try &.free
@timeout_select_action = nil

@alive = false
{% unless flag?(:interpreted) %}
Crystal::Scheduler.stack_pool.release(@stack)
{% end %}
Crystal::Scheduler.reschedule
end
end

0 comments on commit 94352da

Please sign in to comment.