• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
signal(SIGUSR2, SIG_IGN) not respected by Xcode/GDB?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

signal(SIGUSR2, SIG_IGN) not respected by Xcode/GDB?


  • Subject: signal(SIGUSR2, SIG_IGN) not respected by Xcode/GDB?
  • From: Påhl Melin <email@hidden>
  • Date: Wed, 25 Mar 2009 08:50:50 +0100

I have a C++ singleton class where you call methods to execute
commands that are actually performed by a background thread. When a
command is "requested" it is put in a queue and I use raise(SIGUSR2)
to wake-up the background thread. The reason I use signals to wake-up
the background thread is that it communicates with other processed
using Unix Domain Sockets and is listening to socket activity using a
kqueue() and can also conveniently be used to listen to raised
signals.

When the singleton is constructed the first time I use signal(SIGUSR2,
SIG_IGN) to ignore the default signal handler to kill the process. And
this works great when running the program both in Xcode and in a
terminal window BUT when I put a breakpoint in the program and GDB is
run, the program crashes when raise(SIGUSR2) is executed and kills the
process as if the signal(SIGUSR2, SIG_IGN) had not been called (which
I know has been called).

Is there a problem with disabling signal handling when running GDB in
Xcode? Or am I doing something else wrong?

Thanks for any input,
/ Påhl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: signal(SIGUSR2, SIG_IGN) not respected by Xcode/GDB?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: How to extract the basic info from an audio file?
  • Next by Date: Re: NSTableView updating checkboxes
  • Previous by thread: Re: How to extract the basic info from an audio file?
  • Next by thread: Re: signal(SIGUSR2, SIG_IGN) not respected by Xcode/GDB?
  • Index(es):
    • Date
    • Thread