From: VMware, Inc <> Date: Mon, 26 Sep 2011 18:16:48 +0000 (-0700) Subject: lib/lock: trivial cleanup before a change X-Git-Tag: 2011.09.23-491607~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00bc722e124cbf8d54afa4af1003f49161813de9;p=thirdparty%2Fopen-vm-tools.git lib/lock: trivial cleanup before a change 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 --- diff --git a/open-vm-tools/lib/lock/ul.c b/open-vm-tools/lib/lock/ul.c index dc443e849..1340480f5 100644 --- a/open-vm-tools/lib/lock/ul.c +++ b/open-vm-tools/lib/lock/ul.c @@ -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 */ diff --git a/open-vm-tools/lib/lock/ulInt.h b/open-vm-tools/lib/lock/ulInt.h index 735f8eaac..d5b793e2b 100644 --- a/open-vm-tools/lib/lock/ulInt.h +++ b/open-vm-tools/lib/lock/ulInt.h @@ -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 */ diff --git a/open-vm-tools/lib/lock/ulRW.c b/open-vm-tools/lib/lock/ulRW.c index 041211dff..55111de74 100644 --- a/open-vm-tools/lib/lock/ulRW.c +++ b/open-vm-tools/lib/lock/ulRW.c @@ -657,7 +657,7 @@ static HolderContext * MXUserGetHolderContext(MXUserRWLock *lock) // IN: { HolderContext *result; - void *threadID = MXUserGetNativeTID(); + void *threadID = MXUserGetThreadID(); ASSERT(lock->holderTable);