XFREE(MTYPE_EVENT_POLL, thread_array);
}
-/*
- * event_master_free_unused
- *
- * As threads are finished with they are put on the
- * unuse list for later reuse.
- * If we are shutting down, Free up unused threads
- * So we can see if we forget to shut anything off
- */
-void event_master_free_unused(struct event_loop *m)
-{
- frr_with_mutex (&m->mtx) {
- struct event *t;
-
- while ((t = event_list_pop(&m->unuse)))
- thread_free(m, t);
- }
-}
-
/* Stop thread scheduler. */
void event_master_free(struct event_loop *m)
{
thread = XCALLOC(MTYPE_THREAD, sizeof(struct event));
/* mutex only needs to be initialized at struct creation. */
pthread_mutex_init(&thread->mtx, NULL);
- m->alloc++;
}
thread->type = type;
static void thread_free(struct event_loop *master, struct event *thread)
{
- /* Update statistics. */
- assert(master->alloc > 0);
- master->alloc--;
-
/* Free allocated resources. */
pthread_mutex_destroy(&thread->mtx);
XFREE(MTYPE_THREAD, thread);
int io_pipe[2];
int fd_limit;
struct fd_handler handler;
- unsigned long alloc;
long selectpoll_timeout;
bool spin;
bool handle_signals;
extern struct event_loop *event_master_create(const char *name);
void event_master_set_name(struct event_loop *master, const char *name);
extern void event_master_free(struct event_loop *m);
-extern void event_master_free_unused(struct event_loop *m);
extern void _event_add_read_write(const struct xref_eventsched *xref,
struct event_loop *master,