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

@ -131,16 +131,26 @@ pinos_data_loop_new (void)
PinosDataLoop *this;
impl = calloc (1, sizeof (PinosDataLoopImpl));
if (impl == NULL)
return NULL;
pinos_log_debug ("data-loop %p: new", impl);
this = &impl->this;
this->loop = pinos_loop_new ();
if (this->loop == NULL)
goto no_loop;
pinos_signal_init (&this->destroy_signal);
impl->event = pinos_loop_add_event (this->loop,
do_stop,
impl);
return this;
no_loop:
free (impl);
return NULL;
}
void