diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 10:25:48 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 13:28:36 +0100 |
commit | 9a0958be012e097c239260fac0dec0b1e5679028 (patch) | |
tree | 50eeecf85703a3e4262788427d9bd96b98d2a169 /test/pthread-show-text.c | |
parent | 08b9984da9f2119cd4ed03bbd656a349b49d1f12 (diff) | |
download | cairo-9a0958be012e097c239260fac0dec0b1e5679028.tar.gz |
test: Cleanup after failed pthread_join().
Diffstat (limited to 'test/pthread-show-text.c')
-rw-r--r-- | test/pthread-show-text.c | 17 |
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; |