Exemplo n.º 1
0
void nn_worker_term (struct nn_worker *self)
{
    /*  Ask worker thread to terminate. */
    nn_mutex_lock (&self->sync);
    nn_queue_push (&self->tasks, &self->stop);
    nn_efd_signal (&self->efd);
    nn_mutex_unlock (&self->sync);

    /*  Wait till worker thread terminates. */
    nn_thread_term (&self->thread);

    /*  Clean up. */
    nn_timerset_term (&self->timerset);
    nn_poller_term (&self->poller);
    nn_efd_term (&self->efd);
    nn_queue_item_term (&self->stop);
    nn_queue_term (&self->tasks);
    nn_mutex_term (&self->sync);
}
Exemplo n.º 2
0
void nn_fsm_event_term (struct nn_fsm_event *self)
{
    nn_queue_item_term (&self->item);
}
Exemplo n.º 3
0
void nn_worker_task_term (struct nn_worker_task *self)
{
    nn_queue_item_term (&self->item);
}