summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorpaulzlabn <paulz@labn.net>2018-03-14 13:31:58 -0700
committerGitHub <noreply@github.com>2018-03-14 13:31:58 -0700
commit3f1224cd1a9408bdad6aca8c0c205211cb548d5c (patch)
tree87e6a52a3e7ad7b09caa3207f081fd92bc8fd018 /lib/thread.c
parentfd9b55a2b77c187730600d429b3f290ab58fa035 (diff)
parent6ca96cc6ada990d052fcfc48cffeef454ae64a10 (diff)
Merge branch 'master' into working/master/bgp-vpn-vrf-leaking
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c
index a221c77628..d26be1541f 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)
{