summaryrefslogtreecommitdiff
path: root/lib/frr_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/frr_pthread.h')
-rw-r--r--lib/frr_pthread.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/frr_pthread.h b/lib/frr_pthread.h
index b9e60511d5..9bc7b94033 100644
--- a/lib/frr_pthread.h
+++ b/lib/frr_pthread.h
@@ -25,6 +25,10 @@
#include "memory.h"
#include "thread.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(FRR_PTHREAD);
DECLARE_MTYPE(PTHREAD_PRIM);
@@ -73,7 +77,7 @@ struct frr_pthread {
*/
pthread_cond_t *running_cond;
pthread_mutex_t *running_cond_mtx;
- _Atomic bool running;
+ atomic_bool running;
/*
* Fake thread-specific storage. No constraints on usage. Helpful when
@@ -133,16 +137,13 @@ struct frr_pthread *frr_pthread_new(struct frr_pthread_attr *attr,
const char *name, const char *os_name);
/*
- * Changes the name of the frr_pthread.
+ * Changes the name of the frr_pthread as reported by the operating
+ * system.
*
* @param fpt - the frr_pthread to operate on
- * @param name - Human-readable name
- * @param os_name - 16 characters thread name , including the null
- * terminator ('\0') to set in os.
* @return - on success returns 0 otherwise nonzero error number.
*/
-int frr_pthread_set_name(struct frr_pthread *fpt, const char *name,
- const char *os_name);
+int frr_pthread_set_name(struct frr_pthread *fpt);
/*
* Destroys an frr_pthread.
@@ -214,4 +215,8 @@ void frr_pthread_stop_all(void);
#define pthread_condattr_setclock(A, B)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_PTHREAD_H */