tests: test if thread can block on error
authorMarek Chalupa <mchqwerty@gmail.com>
Tue, 5 Aug 2014 09:39:49 +0000 (11:39 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 22 Aug 2014 09:53:49 +0000 (12:53 +0300)
commit171e0bdace16dca6d532494a076f0970cb8a034c
tree8f240b61070df1a725b913bfa12233d1266da200
parent47208d2ab12c7671e1b8dc80c4d15094f0b310f7
tests: test if thread can block on error

wl_display_read_events() can make a thread wait until some other thread
ends reading. Normally it wakes up all threads after the reading is
done. But there's a place when it does not get to waking up the threads
- when an error occurs. This test reveals bug that can block programs.

If a thread is waiting in wl_display_read_events() and another thread
calls wl_display_read_events and the reading fails,
then the sleeping thread is not woken up. This is because
display_handle_error is using old pthread_cond instead of new
display->reader_cond, that was added along with wl_display_read_events().

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
tests/display-test.c