Commit 94352da 1 parent a6db2a4 commit 94352da Copy full SHA for 94352da
File tree 1 file changed +12
-17
lines changed
1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -66,23 +66,18 @@ class Fiber
66
66
STDERR .flush
67
67
end
68
68
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
-
77
69
# 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
87
82
end
88
83
end
You can’t perform that action at this time.
0 commit comments