data-loop: add option to pthread_cancel the thread

Don't use pthread_cancel by default to stop the data thread but
instead use an eventfd. pthread_cancel uses a signal and is not
nice to use in a library as it can cause strange crashes.

See #211
This commit is contained in:
Wim Taymans 2020-03-02 15:44:47 +01:00
parent ce80e05b25
commit e76351da79
2 changed files with 31 additions and 2 deletions

View file

@ -316,6 +316,7 @@ struct pw_data_loop {
struct pw_loop *loop;
struct spa_hook_list listener_list;
struct spa_source *event;
pthread_t thread;
unsigned int created:1;