]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
VThread_Init: remove VThreadID parameter
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:41 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:41 +0000 (11:23 -0700)
With the removal of static VThreadIDs, there is no longer any need
to specify a specific VThreadID when initializing the VThread library.
We can simply auto-assign an ID instead.

Remove the VThreadID parameter from all callsites.
Remove all VTHREAD_xxx_ID macros (except VTHREAD_INVALID_ID).
Slightly adjust vthreadBase.c to "know" that VThreadIDs now start
at 1, not 5.

open-vm-tools/lib/include/vthreadBase.h
open-vm-tools/lib/misc/vthreadBase.c

index 9d444b97c6263f0f07fb9081d7eb0b6505af8f41..bc9c5b9e9b259eb87bce43e2e1127fb0a430632f 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2006-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -126,12 +126,6 @@ VThread_CurName(void)
 
 #else
 
-#define VTHREAD_VMX_ID          1
-//#define VTHREAD_SVGA_ID         2  /* To be removed shortly */
-//#define VTHREAD_MKS_ID          3
-#define VTHREAD_OTHER_ID        4
-#define VTHREAD_ALLOCSTART_ID   5
-
 #define VTHREADBASE_MAX_NAME    32  /* Arbitrary */
 
 
index ca8e690230379edffed5b3b7a1131005c9457e09..302229fdd4a171c82c7a345fe32c5856ff839762 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2010-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -46,8 +46,6 @@
  *                                  to clean up resource usage prior to thread
  *                                  exit.
  *      Historical quirks:
- *      * Default thread numbering starts at VTHREAD_MAX_VCPUs + 2
- *        to allow VThread_IsVCPU() to run efficiently.
  *      * Most other code uses VThread_Foo instead of VThreadBase_Foo; the
  *        public header file uses inlines to convert names.
  *
@@ -154,7 +152,7 @@ static struct {
 } vthreadBaseGlobals = {
    { VTHREADBASE_INVALID_KEY },
    { VTHREADBASE_INVALID_KEY },
-   { VTHREAD_ALLOCSTART_ID },
+   { VTHREAD_INVALID_ID + 1 },
    { 0 },
    { 0 },
    VThreadBaseSimpleNoID,