static void *fpt_run(void *arg);
static int fpt_halt(struct frr_pthread *fpt, void **res);
+/* misc sigs */
+static void frr_pthread_destroy_nolock(struct frr_pthread *fpt);
+
/* default frr_pthread attributes */
struct frr_pthread_attr frr_pthread_attr_default = {
.start = fpt_run,
frr_pthread_stop_all();
frr_with_mutex(&frr_pthread_list_mtx) {
+ struct listnode *n, *nn;
+ struct frr_pthread *fpt;
+
+ for (ALL_LIST_ELEMENTS(frr_pthread_list, n, nn, fpt)) {
+ listnode_delete(frr_pthread_list, fpt);
+ frr_pthread_destroy_nolock(fpt);
+ }
+
list_delete(&frr_pthread_list);
}
}
return fpt;
}
-void frr_pthread_destroy(struct frr_pthread *fpt)
+static void frr_pthread_destroy_nolock(struct frr_pthread *fpt)
{
- frr_with_mutex(&frr_pthread_list_mtx) {
- listnode_delete(frr_pthread_list, fpt);
- }
-
thread_master_free(fpt->master);
pthread_mutex_destroy(&fpt->mtx);
pthread_mutex_destroy(fpt->running_cond_mtx);
XFREE(MTYPE_FRR_PTHREAD, fpt);
}
+void frr_pthread_destroy(struct frr_pthread *fpt)
+{
+ frr_with_mutex(&frr_pthread_list_mtx) {
+ listnode_delete(frr_pthread_list, fpt);
+ }
+
+ frr_pthread_destroy_nolock(fpt);
+}
+
int frr_pthread_set_name(struct frr_pthread *fpt)
{
int ret = 0;