Project

General

Profile

Actions

Bug #166

closed

Signal handling and sleep() don't work together

Added by pragdave (Dave Thomas) almost 16 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:17270]

Description

=begin
Setting up a sleep seems to interfere with signal handlers. The following code

trap("CLD") do
pid = Process.wait
puts "Child pid #{pid}: terminated"
end

exec("/bin/sh -c 'echo hello'") if fork.nil?
puts "start"
sleep 2
puts "done"

Outputs start/hello/done with no delay, and the trap never fires. Replace the sleep with a gets, and the signal handler gets invoked—it never writes “Child xxx terminated.”
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 16 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r17973.
=end

Actions

Also available in: Atom PDF

Like0
Like0