Skip to content

Commit 94352da

Browse files
committed
fix building
1 parent a6db2a4 commit 94352da

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

src/hacks.cr

+12-17
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,18 @@ class Fiber
6666
STDERR.flush
6767
end
6868
ensure
69-
{% if flag?(:preview_mt) %}
70-
Crystal::Scheduler.enqueue_free_stack @stack
71-
{% elsif flag?(:interpreted) %}
72-
# For interpreted mode we don't need a new stack, the stack is held by the interpreter
73-
{% else %}
74-
Fiber.stack_pool.release(@stack)
75-
{% end %}
76-
7769
# Remove the current fiber from the linked list
78-
Fiber.fibers.delete(self)
79-
80-
# Delete the resume event if it was used by `yield` or `sleep`
81-
@resume_event.try &.free
82-
@timeout_event.try &.free
83-
@timeout_select_action = nil
84-
85-
@alive = false
86-
Crystal::Scheduler.reschedule
70+
Fiber.inactive(self)
71+
72+
# Delete the resume event if it was used by `yield` or `sleep`
73+
@resume_event.try &.free
74+
@timeout_event.try &.free
75+
@timeout_select_action = nil
76+
77+
@alive = false
78+
{% unless flag?(:interpreted) %}
79+
Crystal::Scheduler.stack_pool.release(@stack)
80+
{% end %}
81+
Crystal::Scheduler.reschedule
8782
end
8883
end

0 commit comments

Comments
 (0)