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
[System.Private.CoreLib] Initial build pass #12450
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7e7b474
[System.Private.CoreLib] Initial build pass
marek-safar 8236cf3
Add temporary files not officialy converted to allow to build the lib…
marek-safar 6c13551
Formatting changes
marek-safar 53b24ea
master rebase
marek-safar 8e48fc4
Merge remote-tracking branch 'upstream/master' into build-fixes
marek-safar 4a62677
Merge remote-tracking branch 'upstream/master' into build-fixes
marek-safar 01aaa55
Fixes build
marek-safar 05da723
Doc tests update
marek-safar 8234e8e
Merge remote-tracking branch 'upstream/master' into build-fixes
marek-safar a927157
Bump API snapshot submodule
monojenkins File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// | ||
// System.Private.CoreLib Assembly | ||
// | ||
|
||
using System; | ||
|
||
[assembly: CLSCompliant (true)] |
112 changes: 112 additions & 0 deletions
112
mcs/class/System.Private.CoreLib/Internal.Runtime.Augments/RuntimeThread.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Runtime.ConstrainedExecution; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Internal.Runtime.Augments | ||
{ | ||
public partial class RuntimeThread : CriticalFinalizerObject | ||
{ | ||
// Note: Magic number copied from CoreRT's RuntimeThread.cs. See the original source code for an explanation. | ||
internal static readonly int OptimalMaxSpinWaitsPerSpinIteration = 64; | ||
|
||
readonly Thread thread; | ||
|
||
RuntimeThread (Thread t) | ||
{ | ||
thread = t; | ||
} | ||
|
||
public bool IsBackground { | ||
get { throw new NotImplementedException (); } | ||
set { } | ||
} | ||
|
||
public static RuntimeThread CurrentThread => throw new NotImplementedException (); | ||
|
||
internal static ulong CurrentOSThreadId { | ||
get { | ||
throw new NotImplementedException (); | ||
} | ||
} | ||
|
||
public extern bool IsThreadPoolThread | ||
{ | ||
[MethodImpl (MethodImplOptions.InternalCall)] | ||
get; | ||
} | ||
|
||
public int ManagedThreadId => AsThread ().ManagedThreadId; | ||
|
||
public string Name { | ||
get { | ||
return AsThread ().Name; | ||
} | ||
set { | ||
AsThread ().Name = value; | ||
} | ||
} | ||
|
||
public ThreadPriority Priority { | ||
get { | ||
throw new NotImplementedException (); | ||
} | ||
set { | ||
} | ||
} | ||
|
||
public ThreadState ThreadState { | ||
get { | ||
throw new NotImplementedException (); | ||
} | ||
} | ||
|
||
public extern bool IsAlive { | ||
[MethodImpl(MethodImplOptions.InternalCall)] | ||
get; | ||
} | ||
|
||
public static bool Yield () => Thread.Yield (); | ||
|
||
public void Interrupt () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
private Thread AsThread () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
public static RuntimeThread Create (ThreadStart start) => throw new NotImplementedException (); | ||
public static RuntimeThread Create (ThreadStart start, int maxStackSize) => throw new NotImplementedException (); | ||
public static RuntimeThread Create (ParameterizedThreadStart start) => throw new NotImplementedException (); | ||
public static RuntimeThread Create (ParameterizedThreadStart start, int maxStackSize) => throw new NotImplementedException (); | ||
|
||
public static int GetCurrentProcessorId () | ||
{ | ||
// TODO: Implement correctly | ||
return 1; | ||
} | ||
|
||
public static bool SpinWait (int iterations) | ||
{ | ||
Thread.SpinWait (iterations); | ||
return true; | ||
} | ||
|
||
public static void Sleep (int millisecondsTimeout) => Thread.Sleep (millisecondsTimeout); | ||
|
||
public void Start () => throw new NotImplementedException (); | ||
public void Start (object parameter) => throw new NotImplementedException (); | ||
|
||
public void Join () => JoinInternal (Timeout.Infinite); | ||
|
||
public bool Join (int millisecondsTimeout) => JoinInternal (millisecondsTimeout); | ||
|
||
private bool JoinInternal (int millisecondsTimeout) | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
mcs/class/System.Private.CoreLib/Microsoft.Win32.SafeHandles/SafeWaitHandle.Unix.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading; | ||
|
||
namespace Microsoft.Win32.SafeHandles | ||
{ | ||
partial class SafeWaitHandle | ||
{ | ||
protected override bool ReleaseHandle () | ||
{ | ||
NativeEventCalls.CloseEvent_internal (handle); | ||
return true; | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
mcs/class/System.Private.CoreLib/Microsoft.Win32/UnsafeNativeMethods.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Win32 | ||
{ | ||
static class UnsafeNativeMethods | ||
{ | ||
internal static unsafe class ManifestEtw | ||
{ | ||
internal unsafe delegate void EtwEnableCallback( | ||
[In] ref Guid sourceId, | ||
[In] int isEnabled, | ||
[In] byte level, | ||
[In] long matchAnyKeywords, | ||
[In] long matchAllKeywords, | ||
[In] EVENT_FILTER_DESCRIPTOR* filterData, | ||
[In] void* callbackContext | ||
); | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
unsafe internal struct EVENT_FILTER_DESCRIPTOR | ||
{ | ||
public long Ptr; | ||
public int Size; | ||
public int Type; | ||
} | ||
|
||
internal enum ActivityControl : uint | ||
{ | ||
EVENT_ACTIVITY_CTRL_GET_ID = 1, | ||
EVENT_ACTIVITY_CTRL_SET_ID = 2, | ||
EVENT_ACTIVITY_CTRL_CREATE_ID = 3, | ||
EVENT_ACTIVITY_CTRL_GET_SET_ID = 4, | ||
EVENT_ACTIVITY_CTRL_CREATE_SET_ID = 5 | ||
} | ||
|
||
internal const int ERROR_ARITHMETIC_OVERFLOW = 534; | ||
internal const int ERROR_NOT_ENOUGH_MEMORY = 8; | ||
internal const int ERROR_MORE_DATA = 0xEA; | ||
|
||
internal const int EVENT_CONTROL_CODE_DISABLE_PROVIDER = 0; | ||
internal const int EVENT_CONTROL_CODE_ENABLE_PROVIDER = 1; | ||
internal const int EVENT_CONTROL_CODE_CAPTURE_STATE = 2; | ||
} | ||
} | ||
|
||
// TODO: Should already exist somewhere else | ||
static class Win32Native | ||
{ | ||
internal static int GetCurrentThreadId () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
internal static uint GetCurrentProcessId () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these files use the mono coding conventions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, I suspect some changes will eventually migrate to shared which means coreclr coding convention, do we want to do the conversion at that point?