Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -1,21 +0,0 @@
using System;
internal static partial class Interop
{
internal static IntPtr MemAlloc(UIntPtr sizeInBytes)
{
if (Environment.IsRunningOnWindows)
return Windows_MemAlloc(sizeInBytes);
else
return Unix_MemAlloc(sizeInBytes);
}
internal static void MemFree(IntPtr allocatedMemory)
{
if (Environment.IsRunningOnWindows)
Windows_MemFree(allocatedMemory);
else
Unix_MemFree(allocatedMemory);
}
}

View File

@@ -1,14 +0,0 @@
using System;
internal partial class Interop
{
internal partial class mincore
{
static mincore()
{
if (!Environment.IsRunningOnWindows)
throw new PlatformNotSupportedException();
}
}
}

View File

@@ -0,0 +1,15 @@
namespace System.Threading
{
public sealed class PreAllocatedOverlapped : IDisposable
{
[CLSCompliant (false)]
public unsafe PreAllocatedOverlapped (IOCompletionCallback callback, object state, object pinData)
{
throw new PlatformNotSupportedException ();
}
public void Dispose ()
{
}
}
}

View File

@@ -3,7 +3,7 @@ using System.Threading;
namespace Internal.Runtime.Augments
{
class RuntimeThread
sealed class RuntimeThread
{
readonly Thread thread;
@@ -33,5 +33,11 @@ namespace Internal.Runtime.Augments
Thread.SpinWait (iterations);
return true;
}
public static int GetCurrentProcessorId ()
{
// TODO: Implement correctly
return 1;
}
}
}

View File

@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace System.IO
{
@@ -15,16 +16,19 @@ namespace System.IO
throw new NotImplementedException ();
}
public virtual ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default(CancellationToken))
public virtual ValueTask<int> ReadAsync (Memory<byte> destination, CancellationToken cancellationToken = default(CancellationToken))
{
if (destination.TryGetArray (out ArraySegment<byte> array))
if (MemoryMarshal.TryGetArray (destination, out ArraySegment<byte> array))
return new ValueTask<int> (ReadAsync (array.Array, array.Offset, array.Count, cancellationToken));
throw new NotImplementedException ();
}
public virtual Task WriteAsync (ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default(CancellationToken))
public virtual ValueTask WriteAsync (ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default(CancellationToken))
{
if (MemoryMarshal.TryGetArray (source, out ArraySegment<byte> array))
return new ValueTask (WriteAsync (array.Array, array.Offset, array.Count, cancellationToken));
throw new NotImplementedException ();
}
}

View File

@@ -1,5 +1,3 @@
#if !MULTIPLEX_OS
namespace System.Threading
{
public sealed class ThreadPoolBoundHandle : IDisposable
@@ -48,18 +46,4 @@ namespace System.Threading
throw new PlatformNotSupportedException ();
}
}
public sealed partial class PreAllocatedOverlapped : IDisposable
{
[System.CLSCompliantAttribute (false)]
public PreAllocatedOverlapped (System.Threading.IOCompletionCallback callback, object state, object pinData)
{
throw new PlatformNotSupportedException ();
}
public void Dispose ()
{
}
}
}
#endif