summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids_precise.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/sna_trapezoids_precise.c')
-rw-r--r--src/sna/sna_trapezoids_precise.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index e5bab16b..bc0a7e7c 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -2849,19 +2849,23 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
h = (h + num_threads - 1) / num_threads;
num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1;
- for (n = 1; n < num_threads; n++) {
- threads[n] = threads[0];
- threads[n].extents.y1 = y;
- threads[n].extents.y2 = y += h;
+ if (sigtrap_get() == 0) {
+ for (n = 1; n < num_threads; n++) {
+ threads[n] = threads[0];
+ threads[n].extents.y1 = y;
+ threads[n].extents.y2 = y += h;
- sna_threads_run(inplace_x8r8g8b8_thread, &threads[n]);
- }
+ sna_threads_run(inplace_x8r8g8b8_thread, &threads[n]);
+ }
- assert(y < threads[0].extents.y2);
- threads[0].extents.y1 = y;
- inplace_x8r8g8b8_thread(&threads[0]);
+ assert(y < threads[0].extents.y2);
+ threads[0].extents.y1 = y;
+ inplace_x8r8g8b8_thread(&threads[0]);
- sna_threads_wait();
+ sna_threads_wait();
+ sigtrap_put();
+ } else
+ sna_threads_kill(); /* leaks thread allocations */
}
return true;
@@ -3124,19 +3128,23 @@ precise_trapezoid_span_inplace(struct sna *sna,
h = (h + num_threads - 1) / num_threads;
num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1;
- for (n = 1; n < num_threads; n++) {
- threads[n] = threads[0];
- threads[n].extents.y1 = y;
- threads[n].extents.y2 = y += h;
+ if (sigtrap_get() == 0) {
+ for (n = 1; n < num_threads; n++) {
+ threads[n] = threads[0];
+ threads[n].extents.y1 = y;
+ threads[n].extents.y2 = y += h;
- sna_threads_run(inplace_thread, &threads[n]);
- }
+ sna_threads_run(inplace_thread, &threads[n]);
+ }
- assert(y < threads[0].extents.y2);
- threads[0].extents.y1 = y;
- inplace_thread(&threads[0]);
+ assert(y < threads[0].extents.y2);
+ threads[0].extents.y1 = y;
+ inplace_thread(&threads[0]);
- sna_threads_wait();
+ sna_threads_wait();
+ sigtrap_put();
+ } else
+ sna_threads_kill(); /* leaks thread allocations */
}
return true;