From 8b0e61b4ff143b8ec3c5a92a9b90c093af0c3d3c Mon Sep 17 00:00:00 2001 From: Julien Portalier Date: Thu, 16 Jan 2025 11:38:00 +0100 Subject: [PATCH] Fix: undefined method 'sig_suspend' for GC:Module (gc_none) The gc_none interface doesn't define the `sig_suspend` nor `sig_resume` class methods. The program should still compile but commit 57017f6 improperly checks for the method existence, and the methods are always required and the fallback never used. --- src/crystal/system/unix/pthread.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crystal/system/unix/pthread.cr b/src/crystal/system/unix/pthread.cr index 73aa2a652ca1..98629a70fbb6 100644 --- a/src/crystal/system/unix/pthread.cr +++ b/src/crystal/system/unix/pthread.cr @@ -269,16 +269,16 @@ module Crystal::System::Thread {% end %} def self.sig_suspend : ::Signal - if GC.responds_to?(:sig_suspend) - GC.sig_suspend + if (gc = GC).responds_to?(:sig_suspend) + gc.sig_suspend else ::Signal.new(SIG_SUSPEND) end end def self.sig_resume : ::Signal - if GC.responds_to?(:sig_resume) - GC.sig_resume + if (gc = GC).responds_to?(:sig_resume) + gc.sig_resume else ::Signal.new(SIG_RESUME) end