Implement subscription with a signal

Use a signal for subscription events
Work on handling OOM errors and other errors.
This commit is contained in:
Wim Taymans 2016-12-22 16:50:01 +01:00
parent 1b66bbcffd
commit 85d375e4bb
32 changed files with 531 additions and 176 deletions

View file

@ -83,12 +83,14 @@ pinos_thread_main_loop_new (PinosLoop *loop,
pthread_mutexattr_t attr;
impl = calloc (1, sizeof (PinosThreadMainLoopImpl));
if (impl == NULL)
return NULL;
this = &impl->this;
pinos_log_debug ("thread-mainloop %p: new", impl);
this->loop = loop;
if (name)
this->name = strdup (name);
this->name = name ? strdup (name) : NULL;
pinos_loop_set_hooks (loop,
pre_hook,
@ -97,7 +99,6 @@ pinos_thread_main_loop_new (PinosLoop *loop,
pinos_signal_init (&this->destroy_signal);
pthread_mutexattr_init (&attr);
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&impl->lock, &attr);