]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/lock: pick up review comments
authorVMware, Inc <>
Thu, 17 Jun 2010 21:40:26 +0000 (14:40 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 21:40:26 +0000 (14:40 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ul.c
open-vm-tools/lib/lock/ulExcl.c
open-vm-tools/lib/lock/ulInt.h
open-vm-tools/lib/lock/ulRW.c
open-vm-tools/lib/lock/ulRec.c

index d4a57f36089981cf47b0645eae5defc73640cc37..251c1888e22261abe308b1df6adb1d121398609c 100644 (file)
@@ -21,6 +21,7 @@
 #include "util.h"
 #include "userlock.h"
 #include "ulInt.h"
+#include "ulIntShared.h"
 #include "hashTable.h"
 
 
index 82f0ccb9be93b60c61a43dd082af3f46446eb64a..4b90e409c9851713966cb024040afeb26a140ab8 100644 (file)
@@ -20,6 +20,7 @@
 #include "str.h"
 #include "util.h"
 #include "userlock.h"
+#include "hostinfo.h"
 #include "ulInt.h"
 
 #define MXUSER_EXCL_SIGNATURE 0x58454B4C // 'LKEX' in memory
@@ -30,7 +31,7 @@ struct MXUserExclLock
    MXRecLock               recursiveLock;
 
 #if defined(MXUSER_STATS)
-   uint64                  holdStart;
+   VmTimeType              holdStart;
 
    MXUserAcquisitionStats  acquisitionStats;
    Atomic_Ptr              acquisitionHisto;
@@ -268,8 +269,8 @@ void
 MXUser_AcquireExclLock(MXUserExclLock *lock)  // IN/OUT:
 {
 #if defined(MXUSER_STATS)
-   uint64 begin;
-   uint64 value;
+   VmTimeType begin;
+   VmTimeType value;
    Bool contended;
    MXUserHisto *histo;
 #endif
@@ -330,7 +331,7 @@ void
 MXUser_ReleaseExclLock(MXUserExclLock *lock)  // IN/OUT:
 {
 #if defined(MXUSER_STATS)
-   uint64 value;
+   VmTimeType value;
    MXUserHisto *histo;
 #endif
 
@@ -390,7 +391,7 @@ MXUser_TryAcquireExclLock(MXUserExclLock *lock)  // IN/OUT:
    Bool success;
 
 #if defined(MXUSER_STATS)
-   uint64 begin;
+   VmTimeType begin;
 #endif
 
    ASSERT(lock && (lock->header.lockSignature == MXUSER_EXCL_SIGNATURE));
@@ -407,7 +408,7 @@ MXUser_TryAcquireExclLock(MXUserExclLock *lock)  // IN/OUT:
 
    if (success) {
 #if defined(MXUSER_STATS)
-      uint64 end = Hostinfo_SystemTimerNS();
+      VmTimeType end = Hostinfo_SystemTimerNS();
 #endif
 
       MXUserAcquisitionTracking(&lock->header, FALSE);
index 37ca5f2cdae623a768d698372f6d8f731b65b0a3..29f573d945904be151b781971eb2b9821e1c9154 100644 (file)
@@ -38,8 +38,6 @@ typedef pthread_t MXThreadID;
 
 #include "vm_basic_types.h"
 #include "vthreadBase.h"
-#include "hostinfo.h"
-#include "ulIntShared.h"
 
 #if defined(MXUSER_STATS)
 #include "circList.h"
index 3f2d32771f35783dc32b106a8e694a078024a698..0dd0e349415179ad06f219bd7bed5085cb820c6f 100644 (file)
@@ -25,6 +25,7 @@
 #include "util.h"
 #include "hashTable.h"
 #include "userlock.h"
+#include "hostinfo.h"
 #include "ulInt.h"
 
 #define MXUSER_RW_SIGNATURE 0x57524B4C // 'LKRW' in memory
@@ -232,7 +233,7 @@ typedef enum {
 
 typedef struct {
 #if defined(MXUSER_STATS)
-   uint64       holdStart;
+   VmTimeType   holdStart;
 #endif
 
    HolderState  state;
@@ -601,8 +602,8 @@ MXUserAcquisition(MXUserRWLock *lock,  // IN/OUT:
    HolderContext *myContext;
 
 #if defined(MXUSER_STATS)
-   uint64 begin;
-   uint64 value;
+   VmTimeType begin;
+   VmTimeType value;
    MXUserHisto *histo;
 #endif
 
@@ -783,8 +784,8 @@ MXUser_ReleaseRWLock(MXUserRWLock *lock)  // IN/OUT:
    HolderContext *myContext;
 
 #if defined(MXUSER_STATS)
-   uint64 holdEnd = Hostinfo_SystemTimerNS();
-   uint64 duration;
+   VmTimeType holdEnd = Hostinfo_SystemTimerNS();
+   VmTimeType duration;
    MXUserHisto *histo;
 #endif
 
index 9158a90f39da36cda8ddda4cdc9897873cc04daf..ca27248c10363c97e0d0c62b5848e2549b52e20a 100644 (file)
@@ -20,6 +20,7 @@
 #include "str.h"
 #include "util.h"
 #include "userlock.h"
+#include "hostinfo.h"
 #include "ulInt.h"
 
 #define MXUSER_REC_SIGNATURE 0x43524B4C // 'LKRC' in memory
@@ -303,7 +304,7 @@ MXUser_AcquireRecLock(MXUserRecLock *lock)  // IN/OUT:
    } else {
 #if defined(MXUSER_STATS)
       Bool contended;
-      uint64 begin;
+      VmTimeType begin;
 #endif
       /* Rank checking is only done on the first acquisition */
       MXUserAcquisitionTracking(&lock->header, TRUE);
@@ -319,7 +320,7 @@ MXUser_AcquireRecLock(MXUserRecLock *lock)  // IN/OUT:
 #if defined(MXUSER_STATS)
       if (MXRecLockCount(&lock->recursiveLock) == 1) {
          MXUserHisto *histo;
-         uint64 value = Hostinfo_SystemTimerNS() - begin;
+         VmTimeType value = Hostinfo_SystemTimerNS() - begin;
 
          MXUserAcquisitionSample(&lock->acquisitionStats, contended, value);
 
@@ -363,7 +364,7 @@ MXUser_ReleaseRecLock(MXUserRecLock *lock)  // IN/OUT:
    } else {
 #if defined(MXUSER_STATS)
       if (MXRecLockCount(&lock->recursiveLock) == 1) {
-         uint64 value = Hostinfo_SystemTimerNS() - lock->holdStart;
+         VmTimeType value = Hostinfo_SystemTimerNS() - lock->holdStart;
          MXUserHisto *histo = Atomic_ReadPtr(&lock->heldHisto);
 
          MXUserBasicStatsSample(&lock->heldStats, value);
@@ -425,7 +426,7 @@ MXUser_TryAcquireRecLock(MXUserRecLock *lock)  // IN/OUT:
       success = (*MXUserMX_TryLockRec)(lock->vmmLock);
    } else {
 #if defined(MXUSER_STATS)
-      uint64 begin;
+      VmTimeType begin;
 #endif
 
       if (MXUserTryAcquireFail(lock->header.lockName)) {