]> granicus.if.org Git - postgis/commitdiff
Register a GEOS interrupt callback to dispatch windows events
authorSandro Santilli <strk@keybit.net>
Thu, 7 Jun 2012 15:18:08 +0000 (15:18 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 7 Jun 2012 15:18:08 +0000 (15:18 +0000)
NOTE: won't build on WIN32 with GEOS-3.4.0SVN < r3672

git-svn-id: http://svn.osgeo.org/postgis/trunk@9857 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis_module.c

index 121dff2efa7ff87f1f4c55f2fe9b695e9dc7f24a..9599a6d2a3869c95de33cc6aaf32dc8aab4adc1c 100644 (file)
@@ -30,6 +30,15 @@ PG_MODULE_MAGIC;
 static pqsigfunc coreIntHandler = 0;
 static void handleInterrupt(int sig);
 
+#ifdef WIN32
+#if POSTGIS_GEOS_VERSION >= 34 
+static void geosInterruptCallback() {
+  if (UNBLOCKED_SIGNAL_QUEUE()) 
+    pgwin32_dispatch_queued_signals(); 
+}
+#endif
+#endif
+
 /*
  * Module load callback
  */
@@ -40,6 +49,12 @@ _PG_init(void)
 
   coreIntHandler = pqsignal(SIGINT, handleInterrupt); 
 
+#ifdef WIN32
+#if POSTGIS_GEOS_VERSION >= 34 
+  GEOS_interruptRegisterCallback();
+#endif
+#endif
+
 #if 0
   /* Define custom GUC variables. */
   DefineCustomIntVariable(