util: introduce a common interface for setting thread names
[openafs.git] / src / util / afsutil_prototypes.h
index b7b6add..1505386 100644 (file)
@@ -144,6 +144,20 @@ extern int parseNetFiles(afs_uint32 addrbuf[], afs_uint32 maskbuf[],
 /* pthread_glock.c */
 
 
+/* pthread_threadname.c */
+#if AFS_PTHREAD_ENV && !defined(AFS_NT40_ENV)
+extern void afs_pthread_setname(pthread_t thread, const char *threadname);
+extern void afs_pthread_setname_self(const char *threadname);
+#elif defined(AFS_NT40_ENV)
+# define afs_pthread_setname(thread, threadname) (void)0
+# define afs_pthread_setname_self(threadname) (void)0
+#else
+/* Allow unconditional references to afs_pthread_setname_self to
+ * reduce #ifdef spaghetti.
+ */
+#define afs_pthread_setname_self(threadname) (void)0
+#endif
+
 /* readdir_nt.c */