diff options
Diffstat (limited to 'lib/frr_pthread.c')
| -rw-r--r-- | lib/frr_pthread.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index 0c617238fa..c4ead01bf6 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -75,7 +75,7 @@ struct frr_pthread *frr_pthread_new(const struct frr_pthread_attr *attr, /* initialize mutex */ pthread_mutex_init(&fpt->mtx, NULL); /* create new thread master */ - fpt->master = thread_master_create(name); + fpt->master = event_master_create(name); /* set attributes */ fpt->attr = *attr; name = (name ? name : "Anonymous thread"); @@ -101,7 +101,7 @@ struct frr_pthread *frr_pthread_new(const struct frr_pthread_attr *attr, static void frr_pthread_destroy_nolock(struct frr_pthread *fpt) { - thread_master_free(fpt->master); + event_master_free(fpt->master); pthread_mutex_destroy(&fpt->mtx); pthread_mutex_destroy(fpt->running_cond_mtx); pthread_cond_destroy(fpt->running_cond); @@ -224,14 +224,14 @@ void frr_pthread_stop_all(void) */ /* dummy task for sleeper pipe */ -static void fpt_dummy(struct thread *thread) +static void fpt_dummy(struct event *thread) { } /* poison pill task to end event loop */ -static void fpt_finish(struct thread *thread) +static void fpt_finish(struct event *thread) { - struct frr_pthread *fpt = THREAD_ARG(thread); + struct frr_pthread *fpt = EVENT_ARG(thread); atomic_store_explicit(&fpt->running, false, memory_order_relaxed); } @@ -239,7 +239,7 @@ static void fpt_finish(struct thread *thread) /* stop function, called from other threads to halt this one */ static int fpt_halt(struct frr_pthread *fpt, void **res) { - thread_add_event(fpt->master, &fpt_finish, fpt, 0, NULL); + event_add_event(fpt->master, &fpt_finish, fpt, 0, NULL); pthread_join(fpt->thread, res); return 0; @@ -281,7 +281,7 @@ static void *fpt_run(void *arg) int sleeper[2]; pipe(sleeper); - thread_add_read(fpt->master, &fpt_dummy, NULL, sleeper[0], NULL); + event_add_read(fpt->master, &fpt_dummy, NULL, sleeper[0], NULL); fpt->master->handle_signals = false; @@ -289,11 +289,11 @@ static void *fpt_run(void *arg) frr_pthread_notify_running(fpt); - struct thread task; + struct event task; while (atomic_load_explicit(&fpt->running, memory_order_relaxed)) { pthread_testcancel(); - if (thread_fetch(fpt->master, &task)) { - thread_call(&task); + if (event_fetch(fpt->master, &task)) { + event_call(&task); } } |
