]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/lock: trivial cleanup before a change
authorVMware, Inc <>
Mon, 26 Sep 2011 18:16:48 +0000 (11:16 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Sep 2011 18:16:48 +0000 (11:16 -0700)
Change MXUserGetNativeTID to MXUserGetThreadID - don't imply anything
about where the thread ID is derived from, we may choose native and
portable implementations.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ul.c
open-vm-tools/lib/lock/ulInt.h
open-vm-tools/lib/lock/ulRW.c

index dc443e849c944dc1c0a8c78ffc7240d9726c4b82..1340480f5f00eadbbe8794d7f369bec5183e4017 100644 (file)
@@ -130,7 +130,7 @@ MXUserGetPerThread(void *tid,      // IN: native thread ID
 void
 MXUserListLocks(void)
 {
-   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetNativeTID(),
+   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetThreadID(),
                                                    FALSE);
 
    if (perThread != NULL) {
@@ -166,7 +166,7 @@ MXUserListLocks(void)
 Bool
 MXUser_IsCurThreadHoldingLocks(void)
 {
-   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetNativeTID(),
+   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetThreadID(),
                                                    FALSE);
 
    return (perThread == NULL) ? FALSE : (perThread->locksHeld != 0);
@@ -245,7 +245,7 @@ MXUserCurrentRank(void)
    MX_Rank maxRank;
    MXUserPerThread *perThread; 
 
-   perThread = MXUserGetPerThread(MXUserGetNativeTID(), FALSE);
+   perThread = MXUserGetPerThread(MXUserGetThreadID(), FALSE);
 
    if (perThread == NULL) {
       maxRank = RANK_UNRANKED;
@@ -278,7 +278,7 @@ void
 MXUserAcquisitionTracking(MXUserHeader *header,  // IN:
                           Bool checkRank)        // IN:
 {
-   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetNativeTID(), TRUE);
+   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetThreadID(), TRUE);
 
    ASSERT_NOT_IMPLEMENTED(perThread->locksHeld < MXUSER_MAX_LOCKS_PER_THREAD);
 
@@ -357,7 +357,7 @@ MXUserReleaseTracking(MXUserHeader *header)  // IN: lock, via its header
 {
    uint32 i;
    uint32 lastEntry;
-   void *tid = MXUserGetNativeTID();
+   void *tid = MXUserGetThreadID();
    MXUserPerThread *perThread = MXUserGetPerThread(tid, FALSE);
 
    /* MXUserAcquisitionTracking should have already created a perThread */
index 735f8eaac2956c14a27e914a3fbb867272fd58a1..d5b793e2ba342b2c02d224680ccfc982fed3d2fc 100644 (file)
@@ -361,13 +361,13 @@ MXRecLockRelease(MXRecLock *lock)  // IN/OUT:
 /*
  *-----------------------------------------------------------------------------
  *
- * MXUserGetNativeTID --
+ * MXUserGetThreadID --
  *
- *      Gets a native representation of the thread ID, which can be stored
- *      in a pointer.
+ *      Obtains a unique thread identifier (ID) which can be stored in a
+ *      pointer.
  *
  * Results:
- *      Native representation of a thread ID.
+ *      As above
  *
  * Side effects:
  *      None.
@@ -376,7 +376,7 @@ MXRecLockRelease(MXRecLock *lock)  // IN/OUT:
  */
 
 static INLINE void *
-MXUserGetNativeTID(void)
+MXUserGetThreadID(void)
 {
    /* All thread types must fit into a uintptr_t  */
 
index 041211dff96e225a75723008dd675bc0271b4526..55111de74283d4348e53446460b510df6d1cdbe2 100644 (file)
@@ -657,7 +657,7 @@ static HolderContext *
 MXUserGetHolderContext(MXUserRWLock *lock)  // IN:
 {
    HolderContext *result;
-   void *threadID = MXUserGetNativeTID();
+   void *threadID = MXUserGetThreadID();
 
    ASSERT(lock->holderTable);