pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
coreclr-git: Eliminate patches/, issues addressed upstream
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Sat Apr 23 14:27:51 2016 +0200
Changeset: 846341826a70b22e1964b6184ef11a64b982b771
Removed Files:
coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
Log Message:
coreclr-git: Eliminate patches/, issues addressed upstream
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=846341826a70b22e1964b6184ef11a64b982b771
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
.../patches/patch-src_pal_src_thread_thread.cpp | 125 ---------------------
1 file changed, 125 deletions(-)
diffs:
diff --git a/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp b/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
deleted file mode 100644
index 54d460e..0000000
--- a/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-$NetBSD$
-
---- src/pal/src/thread/thread.cpp.orig 2016-04-08 23:29:23.000000000 +0000
-+++ src/pal/src/thread/thread.cpp
-@@ -33,6 +33,13 @@ Abstract:
- #include "pal/environ.h"
- #include "pal/init.h"
-
-+#if defined(__NetBSD__) && !HAVE_PTHREAD_GETCPUCLOCKID
-+#include <sys/cdefs.h>
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#include <kvm.h>
-+#endif
-+
- #include <signal.h>
- #include <pthread.h>
- #if HAVE_PTHREAD_NP_H
-@@ -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;
-
-+#elif defined(__NetBSD__) && !HAVE_PTHREAD_GETCPUCLOCKID /* Currently unimplemented */
-+
-+ PAL_ERROR palError;
-+ CPalThread *pThread;
-+ CPalThread *pTargetThread;
-+ IPalObject *pobjThread = NULL;
-+ kvm_t *kd;
-+ int cnt, nlwps;
-+ struct kinfo_lwp *klwp;
-+ int i;
-+ bool found = false;
-+
-+ pThread = InternalGetCurrentThread();
-+
-+ palError = InternalGetThreadDataFromHandle(
-+ pThread,
-+ hThread,
-+ 0, // THREAD_GET_CONTEXT
-+ &pTargetThread,
-+ &pobjThread
-+ );
-+ if (palError != NO_ERROR)
-+ {
-+ ASSERT("Unable to get thread data from handle %p"
-+ "thread\n", hThread);
-+ SetLastError(ERROR_INTERNAL_ERROR);
-+ goto SetTimesToZero;
-+ }
-+
-+ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open");
-+ if (kd == NULL)
-+ {
-+ ASSERT("kvm_open(3) error");
-+ SetLastError(ERROR_INTERNAL_ERROR);
-+ goto SetTimesToZero;
-+ }
-+
-+ pTargetThread->Lock(pThread);
-+
-+ klwp = kvm_getlwps(kd, getpid(), 0, sizeof(struct kinfo_lwp), &nlwps);
-+ if (klwp == NULL || nlwps < 1)
-+ {
-+ kvm_close(kd);
-+ ASSERT("Unable to get clock from %p thread\n", hThread);
-+ SetLastError(ERROR_INTERNAL_ERROR);
-+ pTargetThread->Unlock(pThread);
-+ goto SetTimesToZero;
-+ }
-+
-+ for (i = 0; i < nlwps; i++)
-+ {
-+ if (klwp[i].l_lid == THREADSilentGetCurrentThreadId())
-+ {
-+ found = true;
-+ break;
-+ }
-+ }
-+
-+ if (!found)
-+ {
-+ kvm_close(kd);
-+ ASSERT("Unable to get clock from %p thread\n", hThread);
-+ SetLastError(ERROR_INTERNAL_ERROR);
-+ pTargetThread->Unlock(pThread);
-+ goto SetTimesToZero;
-+ }
-+
-+ pTargetThread->Unlock(pThread);
-+
-+ kvm_close(kd);
-+
-+ calcTime = (__int64) klwp[i].l_rtime_sec * SECS_TO_NS;
-+ calcTime += (__int64) klwp[i].l_rtime_usec * USECS_TO_NS;
-+ lpUserTime->dwLowDateTime = (DWORD)calcTime;
-+ lpUserTime->dwHighDateTime = (DWORD)(calcTime >> 32);
-+
-+ /* NetBSD as of (7.0) doesn't differentiate used time in user/kernel for lwp */
-+ lpKernelTime->dwLowDateTime = 0;
-+ lpKernelTime->dwHighDateTime = 0;
-+
-+ retval = TRUE;
-+ goto GetThreadTimesInternalExit;
-+
- #else //HAVE_MACH_THREADS
-
- PAL_ERROR palError;
Home |
Main Index |
Thread Index |
Old Index