-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Handle NativeOverlapped* coming from both the Windows or Portable thread pool in NativeRuntimeEventSource #97365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a211ca0
be943f0
c34fc39
acc7831
ed142f3
76e578d
a3c111c
f808cfd
7d51d43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,7 +217,7 @@ public unsafe void ThreadPoolWorkerThreadAdjustmentStats( | |
[Event(63, Level = EventLevel.Verbose, Message = Messages.IOEnqueue, Task = Tasks.ThreadPool, Opcode = Opcodes.IOEnqueue, Version = 0, Keywords = Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)] | ||
private unsafe void ThreadPoolIOEnqueue( | ||
IntPtr NativeOverlapped, | ||
IntPtr Overlapped, | ||
IntPtr Overlapped, // 0 if the Windows thread pool is used, the relevant info could be obtained from the NativeOverlapped* if necessary | ||
bool MultiDequeues, | ||
ushort ClrInstanceID = DefaultClrInstanceId) | ||
{ | ||
|
@@ -230,9 +230,14 @@ public unsafe void ThreadPoolIOEnqueue(NativeOverlapped* nativeOverlapped) | |
{ | ||
if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) | ||
{ | ||
#if TARGET_WINDOWS | ||
IntPtr overlapped = ThreadPool.UseWindowsThreadPool ? 0 : (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#else | ||
IntPtr overlapped = (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#endif | ||
ThreadPoolIOEnqueue( | ||
(IntPtr)nativeOverlapped, | ||
(IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(), | ||
overlapped, | ||
false); | ||
} | ||
} | ||
|
@@ -254,7 +259,7 @@ public void ThreadPoolIOEnqueue(RegisteredWaitHandle registeredWaitHandle) | |
[Event(64, Level = EventLevel.Verbose, Message = Messages.IO, Task = Tasks.ThreadPool, Opcode = Opcodes.IODequeue, Version = 0, Keywords = Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)] | ||
private unsafe void ThreadPoolIODequeue( | ||
IntPtr NativeOverlapped, | ||
IntPtr Overlapped, | ||
IntPtr Overlapped, // 0 if the Windows thread pool is used, the relevant info could be obtained from the NativeOverlapped* if necessary | ||
|
||
ushort ClrInstanceID = DefaultClrInstanceId) | ||
{ | ||
LogThreadPoolIODequeue(NativeOverlapped, Overlapped, ClrInstanceID); | ||
|
@@ -266,9 +271,14 @@ public unsafe void ThreadPoolIODequeue(NativeOverlapped* nativeOverlapped) | |
{ | ||
if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) | ||
{ | ||
#if TARGET_WINDOWS | ||
IntPtr overlapped = ThreadPool.UseWindowsThreadPool ? 0 : (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#else | ||
IntPtr overlapped = (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#endif | ||
ThreadPoolIODequeue( | ||
(IntPtr)nativeOverlapped, | ||
(IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode()); | ||
overlapped); | ||
} | ||
} | ||
|
||
|
@@ -300,16 +310,21 @@ public unsafe void ThreadPoolIOPack(NativeOverlapped* nativeOverlapped) | |
{ | ||
if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword)) | ||
{ | ||
#if TARGET_WINDOWS | ||
IntPtr overlapped = ThreadPool.UseWindowsThreadPool ? 0 : (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#else | ||
IntPtr overlapped = (IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode(); | ||
#endif | ||
ThreadPoolIOPack( | ||
(IntPtr)nativeOverlapped, | ||
(IntPtr)Overlapped.GetOverlappedFromNative(nativeOverlapped).GetHashCode()); | ||
overlapped); | ||
} | ||
} | ||
|
||
[Event(65, Level = EventLevel.Verbose, Message = Messages.IO, Task = Tasks.ThreadPool, Opcode = Opcodes.IOPack, Version = 0, Keywords = Keywords.ThreadingKeyword)] | ||
private unsafe void ThreadPoolIOPack( | ||
IntPtr NativeOverlapped, | ||
IntPtr Overlapped, | ||
IntPtr Overlapped, // 0 if the Windows thread pool is used, the relevant info could be obtained from the NativeOverlapped* if necessary | ||
ushort ClrInstanceID = DefaultClrInstanceId) | ||
{ | ||
LogThreadPoolIOPack(NativeOverlapped, Overlapped, ClrInstanceID); | ||
|
Uh oh!
There was an error while loading. Please reload this page.