summaryrefslogtreecommitdiff
path: root/test/pthread-show-text.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-04 10:25:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-04 13:28:36 +0100
commit9a0958be012e097c239260fac0dec0b1e5679028 (patch)
tree50eeecf85703a3e4262788427d9bd96b98d2a169 /test/pthread-show-text.c
parent08b9984da9f2119cd4ed03bbd656a349b49d1f12 (diff)
downloadcairo-9a0958be012e097c239260fac0dec0b1e5679028.tar.gz
test: Cleanup after failed pthread_join().
Diffstat (limited to 'test/pthread-show-text.c')
-rw-r--r--test/pthread-show-text.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/pthread-show-text.c b/test/pthread-show-text.c
index 2d2207620..b6be8dc07 100644
--- a/test/pthread-show-text.c
+++ b/test/pthread-show-text.c
@@ -114,22 +114,23 @@ draw (cairo_t *cr, int width, int height)
cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
cairo_paint (cr);
+ pthread_yield ();
+
for (i = 0; i < N_THREADS; i++) {
void *surface;
if (pthread_equal (threads[i], pthread_self ()))
break;
- if (pthread_join (threads[i], &surface) != 0) {
+ if (pthread_join (threads[i], &surface) == 0) {
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_surface_destroy (surface);
+ cairo_paint (cr);
+
+ cairo_translate (cr, 0, HEIGHT);
+ } else {
test_status = CAIRO_TEST_FAILURE;
- break;
}
-
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_surface_destroy (surface);
- cairo_paint (cr);
-
- cairo_translate (cr, 0, HEIGHT);
}
return test_status;