Sha256: adbd1df5cc1b26f23e021630b23b20bea77777e586b2a1326d42418e4bc7682c

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 KB

Contents

/*****************************************************************************

$Id: sigs.cpp 2291 2006-04-14 03:56:18Z francis $

File:     sigs.cpp
Date:     06Apr06

Copyright (C) 2006 by Francis Cianfrocca. All Rights Reserved.
Gmail: garbagecat20

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*****************************************************************************/

#include "project.h"


bool gTerminateSignalReceived;


/**************
SigtermHandler
**************/

void SigtermHandler (int sig)
{
	// This is a signal-handler, don't do anything frisky. Interrupts are disabled.
	// Set the terminate flag WITHOUT trying to lock a mutex- otherwise we can easily
	// self-deadlock, especially if the event machine is looping quickly.
	gTerminateSignalReceived = true;
}


/*********************
InstallSignalHandlers
*********************/

void InstallSignalHandlers()
{
  static bool bInstalled = false;
  if (!bInstalled) {
    bInstalled = true;
	  signal (SIGINT, SigtermHandler);
  	signal (SIGTERM, SigtermHandler);
	  signal (SIGPIPE, SIG_IGN);
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eventmachine-0.4.0 ext/sigs.cpp
eventmachine-0.4.4 ext/sigs.cpp
eventmachine-0.4.2 ext/sigs.cpp
eventmachine-0.4.3 ext/sigs.cpp
eventmachine-0.4.5 ext/sigs.cpp