diff options
author | Renato Westphal <renato@openbsd.org> | 2018-03-13 22:22:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 22:22:22 +0100 |
commit | 118c1156202f543dde9312fd5bc8ff609b8f7cf3 (patch) | |
tree | bfd99395b5e95e828d2bfeb1aac4dde30d09b21a /lib/thread.c | |
parent | Merge pull request #1806 from vivek-cumulus/evpn-ipv6-tenant-routing (diff) | |
parent | lib: frr_pthread int size nits (diff) | |
download | frr-118c1156202f543dde9312fd5bc8ff609b8f7cf3.tar.xz frr-118c1156202f543dde9312fd5bc8ff609b8f7cf3.zip |
Merge pull request #1831 from qlyoung/frr-pthread-fixups
lib: some frr_pthread fixes
Diffstat (limited to 'lib/thread.c')
-rw-r--r-- | lib/thread.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c index a221c7762..d26be1541 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -343,7 +343,6 @@ static void initializer() pthread_key_create(&thread_current, NULL); } -/* Allocate new thread master. */ struct thread_master *thread_master_create(const char *name) { struct thread_master *rv; @@ -426,6 +425,17 @@ struct thread_master *thread_master_create(const char *name) return rv; } +void thread_master_set_name(struct thread_master *master, const char *name) +{ + pthread_mutex_lock(&master->mtx); + { + if (master->name) + XFREE(MTYPE_THREAD_MASTER, master->name); + master->name = XSTRDUP(MTYPE_THREAD_MASTER, name); + } + pthread_mutex_unlock(&master->mtx); +} + /* Add a new thread to the list. */ static void thread_list_add(struct thread_list *list, struct thread *thread) { |