[mapserver-commits] r12958 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Jan 4 04:32:31 EST 2012


Author: tbonfort
Date: 2012-01-04 01:32:31 -0800 (Wed, 04 Jan 2012)
New Revision: 12958

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapserv.c
Log:
avoid potential gd fontcache deadlock on fastcgi exit signals(#4093)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2012-01-03 19:22:27 UTC (rev 12957)
+++ trunk/mapserver/HISTORY.TXT	2012-01-04 09:32:31 UTC (rev 12958)
@@ -14,6 +14,7 @@
 
 Current Version (SVN trunk, 6.1-dev, future 6.2): 
 -------------------------------------------------
+- avoid potential gd fontcache deadlock on fastcgi exit signals(#4093)
 
 - Adjusted WCS GetCapabilities for an empty list of layers (#4140)
 

Modified: trunk/mapserver/mapserv.c
===================================================================
--- trunk/mapserver/mapserv.c	2012-01-03 19:22:27 UTC (rev 12957)
+++ trunk/mapserver/mapserv.c	2012-01-04 09:32:31 UTC (rev 12958)
@@ -44,6 +44,7 @@
 /************************************************************************/
 /*                      FastCGI cleanup functions.                      */
 /************************************************************************/
+static int exitSignal;
 #ifndef WIN32
 void msCleanupOnSignal( int nInData )
 {
@@ -52,8 +53,7 @@
   /* normal stdio functions. */
   msIO_installHandlers( NULL, NULL, NULL );
   msIO_fprintf( stderr, "In msCleanupOnSignal.\n" );
-  msCleanup();
-  exit( 0 );
+  exitSignal = 1;
 }
 #endif
 
@@ -83,7 +83,7 @@
   struct mstimeval execstarttime, execendtime;
   struct mstimeval requeststarttime, requestendtime;
   mapservObj* mapserv = NULL;
-
+  exitSignal = 0;
   msSetup();
 
   /* Use MS_ERRORFILE and MS_DEBUGLEVEL env vars if set */
@@ -162,7 +162,7 @@
 
   /* In FastCGI case we loop accepting multiple requests.  In normal CGI */
   /* use we only accept and process one request.  */
-  while( FCGI_Accept() >= 0 ) {
+  while( !exitSignal && FCGI_Accept() >= 0 ) {
 #endif /* def USE_FASTCGI */
 
     /* -------------------------------------------------------------------- */



More information about the mapserver-commits mailing list