[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14398] trunk/blender/source/blender/src/ renderwin.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Apr 12 19:34:51 CEST 2008


Revision: 14398
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14398
Author:   blendix
Date:     2008-04-12 19:34:48 +0200 (Sat, 12 Apr 2008)

Log Message:
-----------

Fix for bug #7100: when rendering on solaris, pressing esc could
kill the process. Some time ago SIGVTALRM was replaced with SIGALRM
to solve issues on linux, but this signal can kill the process on
solaris, so now it uses SIGVTALRM again there.

Modified Paths:
--------------
    trunk/blender/source/blender/src/renderwin.c

Modified: trunk/blender/source/blender/src/renderwin.c
===================================================================
--- trunk/blender/source/blender/src/renderwin.c	2008-04-12 16:31:29 UTC (rev 14397)
+++ trunk/blender/source/blender/src/renderwin.c	2008-04-12 17:34:48 UTC (rev 14398)
@@ -1018,7 +1018,7 @@
 }
 
 #else
-/* all other OS's support signal(SIGVTALRM) */
+/* all other OS's support signal(SIGVTALRM/SIGALRM) */
 
 /* XXX The ESC problem: some unix users reported that ESC doesn't cancel
  * renders anymore. Most complaints came from linux, but it's not
@@ -1029,7 +1029,10 @@
  * fixes the problem, at least while we investigate better.
  *
  * ITIMER_REAL (SIGALRM): timer that counts real system time
- * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process */
+ * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process
+ *
+ * Addendum: now SIGVTALRM is used on Solaris again, because SIGALRM can
+ * kill the process there! */
 
 /* POSIX: this function goes in the signal() callback */
 static void interruptESC(int sig)
@@ -1038,7 +1041,11 @@
 	if(G.afbreek==0) G.afbreek= 2;	/* code for read queue */
 
 	/* call again, timer was reset */
+#ifdef __sun
+	signal(SIGVTALRM, interruptESC);
+#else
 	signal(SIGALRM, interruptESC);
+#endif
 }
 
 /* POSIX: initialize timer and signal */
@@ -1053,8 +1060,13 @@
 	tmevalue.it_value.tv_sec = 0;
 	tmevalue.it_value.tv_usec = 10000;
 
+#ifdef __sun
+	signal(SIGVTALRM, interruptESC);
+	setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
+#else
 	signal(SIGALRM, interruptESC);
 	setitimer(ITIMER_REAL, &tmevalue, 0);
+#endif
 }
 
 /* POSIX: stop timer and callback */
@@ -1064,9 +1076,13 @@
 
 	memset(&tmevalue, 0, sizeof(struct itimerval));
 
+#ifdef __sun
+	setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
+	signal(SIGVTALRM, SIG_IGN);
+#else
 	setitimer(ITIMER_REAL, &tmevalue, 0);
 	signal(SIGALRM, SIG_IGN);
-
+#endif
 }
 
 





More information about the Bf-blender-cvs mailing list