]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
VThreadBase: Final cleanups
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:51 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:51 +0000 (11:23 -0700)
open-vm-tools/lib/include/vthreadBase.h
open-vm-tools/lib/misc/vthreadBase.c

index 11534ff2b4555aed2e5129a3579d0f459141284c..f786fe0bef26e922ffa5647c6743869733c4d7c8 100644 (file)
@@ -136,11 +136,6 @@ void VThreadBase_SetName(const char *name);
 /* For implementing a thread library */
 void VThreadBase_ForgetSelf(void);
 
-/*
- * See PR 1626963 and function documentation before thinking about using this.
- */
-void VThreadBase_DeInitialize(void);
-
 /* Match up historical VThread_ names with VThreadBase_ names */
 static INLINE const char *
 VThread_CurName(void)
index 2efc14481af6aac30b8cfaf51da9cf713f5d6abe..fca5860e84e4b72c7b43c5690df764b8ff3f955c 100644 (file)
@@ -178,30 +178,6 @@ static __thread char vthreadName[VTHREADBASE_MAX_NAME];
 #endif /* VMW_HAVE_TLS */
 
 
-/*
- *-----------------------------------------------------------------------------
- *
- * VThreadBase_DeInitialize --
- *
- *      (Vestigial. Will be removed shortly -- kevinc)
- *
- *      See PR 1626963
- *
- * Results:
- *      None
- *
- * Side effects:
- *      None
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-VThreadBase_DeInitialize(void)
-{
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
@@ -465,11 +441,7 @@ VThreadBase_CurName(void)
        * support for the platform.
        */
 
-#ifdef HAVE_TLS
-      static __thread char name[48];
-#else
       static char name[48];
-#endif
       VThreadBaseSafeName(name, sizeof name);
       return name;
    }
@@ -477,52 +449,6 @@ VThreadBase_CurName(void)
 }
 
 
-/*
- *-----------------------------------------------------------------------------
- *
- * VThreadBase_ForgetSelf --
- *
- *      Forget the TLS parts of a thread.
- *
- *      If not intending to reallocate TLS, avoid querying the thread's
- *      VThread_CurName between this call and thread destruction.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-VThreadBase_ForgetSelf(void)
-{
-   if (vmx86_debug) {
-      Log("Forgetting VThreadID %" FMT64 "d (\"%s\").\n",
-          VThread_CurID(), VThread_CurName());
-   }
-
-   /*
-    * The VThreadID is fixed (see StableID above).
-    * Only the name needs clearing.
-    */
-#if defined VMW_HAVE_TLS
-   memset(vthreadName, '\0', sizeof vthreadName);
-#else
-   char *buf;
-
-   ASSERT(vthreadNameKey != 0);
-   ASSERT(!VThreadBase_IsInSignal());
-
-   buf = pthread_getspecific(vthreadNameKey);
-   pthread_setspecific(vthreadNameKey, NULL);
-   free(buf);
-#endif
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
@@ -582,6 +508,52 @@ VThreadBase_SetName(const char *name)  // IN: new name
 }
 
 
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VThreadBase_ForgetSelf --
+ *
+ *      Forget the TLS parts of a thread.
+ *
+ *      If not intending to reallocate TLS, avoid querying the thread's
+ *      VThread_CurName between this call and thread destruction.
+ *
+ * Results:
+ *      None.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VThreadBase_ForgetSelf(void)
+{
+   if (vmx86_debug) {
+      Log("Forgetting VThreadID %" FMT64 "d (\"%s\").\n",
+          VThread_CurID(), VThread_CurName());
+   }
+
+   /*
+    * The VThreadID is fixed (see StableID above).
+    * Only the name needs clearing.
+    */
+#if defined VMW_HAVE_TLS
+   memset(vthreadName, '\0', sizeof vthreadName);
+#else
+   char *buf;
+
+   ASSERT(vthreadNameKey != 0);
+   ASSERT(!VThreadBase_IsInSignal());
+
+   buf = pthread_getspecific(vthreadNameKey);
+   pthread_setspecific(vthreadNameKey, NULL);
+   free(buf);
+#endif
+}
+
+
 #if !defined _WIN32
 /*
  *-----------------------------------------------------------------------------