Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Provide a desktop-only implementation of RuntimeThread.CurrentOSThrea…
Browse files Browse the repository at this point in the history
…dId for Microsoft.Diagnostics.Tracing.EventSource.Redist.
  • Loading branch information
brianrob committed Aug 1, 2018
1 parent 4f12959 commit 267b16e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Expand Up @@ -181,6 +181,7 @@
using System.Text;
using System.Threading;
using Microsoft.Win32;
using Internal.Runtime.Augments;

#if ES_BUILD_STANDALONE
using EventDescriptor = Microsoft.Diagnostics.Tracing.EventDescriptor;
Expand All @@ -196,10 +197,6 @@
using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract;
#endif

#if CORECLR || ES_BUILD_PN
using Internal.Runtime.Augments;
#endif

#if ES_BUILD_STANDALONE
namespace Microsoft.Diagnostics.Tracing
#else
Expand Down
Expand Up @@ -243,3 +243,19 @@ internal static string GetResourceString(string key, params object[] args)
}
}
}

#if ES_BUILD_STANDALONE
namespace Internal.Runtime.Augments
{
internal static class RuntimeThread
{
internal static ulong CurrentOSThreadId
{
get { return GetCurrentThreadId(); }
}

[DllImport("kernel32.dll")]
private static extern uint GetCurrentThreadId();
}
}
#endif

0 comments on commit 267b16e

Please sign in to comment.