Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2006-06-11 22:29:25 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2006-06-11 22:29:25 +0400
commit7840570b16084cccd472d08fbf07811a1d169f54 (patch)
treeed2c3b08d0d4ec104ef4c1943e2be332c6064850 /source/blender/src/renderwin.c
parent761190a14d230ca2811b55ce9cd8726e19851794 (diff)
The "ESC doesn't cancel renders" problem:
Changing from ITIMER_VIRTUAL to ITIMER_REAL solved the issue for all who tested it (Hos, pidhash and me, at least). Ton said to commit it so more people can test, but other solutions may still be investigated. The change is only for POSIX systems (so Windows code was not touched).
Diffstat (limited to 'source/blender/src/renderwin.c')
-rw-r--r--source/blender/src/renderwin.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c
index 8aade84fe83..4a93afd6137 100644
--- a/source/blender/src/renderwin.c
+++ b/source/blender/src/renderwin.c
@@ -1010,6 +1010,17 @@ static void end_test_break_callback()
#else
/* all other OS's support signal(SIGVTALRM) */
+/* XXX The ESC problem: some unix users reported that ESC doesn't cancel
+ * renders anymore. Most complaints came from linux, but it's not
+ * general, not all linux users have the problem.
+ *
+ * From tests, the systems that do have it are not signalling SIGVTALRM
+ * interrupts (an issue with signals and threads). Using SIGALRM instead
+ * 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 */
+
/* POSIX: this function goes in the signal() callback */
static void interruptESC(int sig)
{
@@ -1017,7 +1028,7 @@ static void interruptESC(int sig)
if(G.afbreek==0) G.afbreek= 2; /* code for read queue */
/* call again, timer was reset */
- signal(SIGVTALRM, interruptESC);
+ signal(SIGALRM, interruptESC);
}
/* POSIX: initialize timer and signal */
@@ -1032,9 +1043,8 @@ static void init_test_break_callback()
tmevalue.it_value.tv_sec = 0;
tmevalue.it_value.tv_usec = 10000;
- signal(SIGVTALRM, interruptESC);
- setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
-
+ signal(SIGALRM, interruptESC);
+ setitimer(ITIMER_REAL, &tmevalue, 0);
}
/* POSIX: stop timer and callback */
@@ -1044,8 +1054,9 @@ static void end_test_break_callback()
tmevalue.it_value.tv_sec = 0;
tmevalue.it_value.tv_usec = 0;
- setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
- signal(SIGVTALRM, SIG_IGN);
+
+ setitimer(ITIMER_REAL, &tmevalue, 0);
+ signal(SIGALRM, SIG_IGN);
}