aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-08-08 18:25:48 -0700
committerGarrett D'Amore <garrett@damore.org>2020-08-08 19:30:17 -0700
commit6c5070d9157ab0de667568655f0bbeb60780d701 (patch)
treeab1a03e16907c97e6d76f1d95d79aea0f4a875ce /include
parentddc0d044dd0fcf4aa1dc333fd5bda0de47850a64 (diff)
downloadnng-6c5070d9157ab0de667568655f0bbeb60780d701.tar.gz
nng-6c5070d9157ab0de667568655f0bbeb60780d701.tar.bz2
nng-6c5070d9157ab0de667568655f0bbeb60780d701.zip
fixes #960 NNG threads inherit application thread name
This also exposes an nng_thread_set_name() function for applications to use. All NNG thread names start with "nng:". Note that support is highly dependent on the operating system.
Diffstat (limited to 'include')
-rw-r--r--include/nng/supplemental/util/platform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/nng/supplemental/util/platform.h b/include/nng/supplemental/util/platform.h
index 87e0305f..feca858a 100644
--- a/include/nng/supplemental/util/platform.h
+++ b/include/nng/supplemental/util/platform.h
@@ -49,6 +49,11 @@ typedef struct nng_thread nng_thread;
// I/O APIs provided by nng. The thread runs until completion.
NNG_DECL int nng_thread_create(nng_thread **, void (*)(void *), void *);
+// Set the thread name. Support for this is platform specific and varies.
+// It is intended to provide information for use when debugging applications,
+// and not for programmatic use beyond that.
+NNG_DECL void nng_thread_set_name(nng_thread *, const char *);
+
// Destroy a thread (waiting for it to complete.) When this function
// returns all resources for the thread are cleaned up.
NNG_DECL void nng_thread_destroy(nng_thread *);