pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Fix usec to nsec calculation



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Apr 22 10:02:50 2016 +0200
Changeset:	35b11f69f819c914d6df16a6b55dfc4bf349c687

Modified Files:
	coreclr-git/distinfo
	coreclr-git/patches/patch-src_pal_src_thread_thread.cpp

Log Message:
coreclr-git: Fix usec to nsec calculation

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35b11f69f819c914d6df16a6b55dfc4bf349c687

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/distinfo                                |  2 +-
 .../patches/patch-src_pal_src_thread_thread.cpp     | 21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index 10bcdff..a50d69e 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -1,3 +1,3 @@
 $NetBSD$
 
-SHA1 (patch-src_pal_src_thread_thread.cpp) = e981083b870befce2eee1b34c2b386702d0b5533
+SHA1 (patch-src_pal_src_thread_thread.cpp) = 9d761fdff24305d630d46be621a5baeb93f6ea04
diff --git a/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp b/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
index f970cb7..54d460e 100644
--- a/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
+++ b/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
@@ -16,7 +16,24 @@ $NetBSD$
  #include <signal.h>
  #include <pthread.h>
  #if HAVE_PTHREAD_NP_H
-@@ -1399,6 +1406,89 @@ CorUnix::GetThreadTimesInternal(
+@@ -1331,6 +1338,7 @@ CorUnix::GetThreadTimesInternal(
+     __int64 calcTime;
+     BOOL retval = FALSE;
+     const __int64 SECS_TO_NS = 1000000000; /* 10^9 */
++    const __int64 USECS_TO_NS = 1000;      /* 10^3 */
+ 
+ #if HAVE_MACH_THREADS
+     thread_basic_info resUsage;
+@@ -1340,8 +1348,6 @@ CorUnix::GetThreadTimesInternal(
+     IPalObject *pobjThread = NULL;
+     mach_msg_type_number_t resUsage_count = THREAD_BASIC_INFO_COUNT;
+ 
+-    const __int64 USECS_TO_NS = 1000;      /* 10^3 */
+-
+     pthrCurrent = InternalGetCurrentThread();
+     palError = InternalGetThreadDataFromHandle(
+         pthrCurrent,
+@@ -1399,6 +1405,89 @@ CorUnix::GetThreadTimesInternal(
  
      goto GetThreadTimesInternalExit;
  
@@ -92,7 +109,7 @@ $NetBSD$
 +    kvm_close(kd);
 +
 +    calcTime = (__int64) klwp[i].l_rtime_sec * SECS_TO_NS;
-+    calcTime += (__int64) klwp[i].l_rtime_usec / 1000;
++    calcTime += (__int64) klwp[i].l_rtime_usec * USECS_TO_NS;
 +    lpUserTime->dwLowDateTime = (DWORD)calcTime;
 +    lpUserTime->dwHighDateTime = (DWORD)(calcTime >> 32);
 +


Home | Main Index | Thread Index | Old Index