• 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
Re: Daemon Advice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Daemon Advice?


  • Subject: Re: Daemon Advice?
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 23 Jul 2008 15:20:22 -0600


On Jul 23, 2008, at 2:09 PM, Karl Moskowski wrote:

void handleSignal (int signal) {
	NSLog(@"Shutting daemon down");

	AnObject * anObject = [[AnObject alloc] init];
	[anObject doCleanup];

[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"DaemonHasShutDown" object:nil userInfo:nil options:NSNotificationPostToAllSessions];
exit(EXIT_SUCCESS);
}
int main (int argc, const char * argv[]) {
signal (SIGTERM, handleSignal);
signal (SIGINT, handleSignal);


Calling ObjC methods in a signal handler is not a good idea: <http://lists.apple.com/archives/Cocoa-dev/2001/Dec/msg00159.html >

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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: Daemon Advice?
      • From: Jens Alfke <email@hidden>
References: 
 >Daemon Advice? (From: Karl Moskowski <email@hidden>)

  • Prev by Date: Re: Spotlight and NSPredicate
  • Next by Date: Re: NSPredicateEditorRowTemplate and ANY predicate
  • Previous by thread: Daemon Advice?
  • Next by thread: Re: Daemon Advice?
  • Index(es):
    • Date
    • Thread