Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop & start the world (undocumented API) #14729

Merged
Prev Previous commit
Next Next commit
Use same suspend/resume signals has bdwgc
  • Loading branch information
ysbaddaden committed Jun 27, 2024
commit 196253fbfc7da02ac4aa442d74ee1466ebdc8351
16 changes: 14 additions & 2 deletions src/gc/none.cr
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,29 @@ module GC

# :nodoc:
class_property(sig_suspend : Int32) do
# follows bdwgc
{% if flag?(:unix) %}
LibC::SIGUSR1
{% if flag?(:linux) %}
LibC::SIGPWR
{% elsif LibC.has_constant?(:SIGRTMIN) %}
LibC::SIGRTMIN + 6
{% else %}
LibC::SIGXFSZ
{% end %}
{% else %}
-1
{% end %}
end

# :nodoc:
class_property(sig_resume : Int32) do
# follows bdwgc
{% if flag?(:unix) %}
LibC::SIGUSR2
{% if LibC.has_constant?(:SIGRTMIN) %}
LibC::SIGRTMIN + 5
{% else %}
LibC::SIGXCPU
{% end %}
{% else %}
-1
{% end %}
Expand Down
2 changes: 2 additions & 0 deletions src/lib_c/x86_64-freebsd/c/signal.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ lib LibC
SIGEMT = 7
SIGINFO = 29
SIGWINCH = 28
SIGRTMIN = 65
SIGRTMIN = 126
SIGSTKSZ = 2048 + 32768 # MINSIGSTKSZ + 32768

SIG_SETMASK = 3
Expand Down