Imported Upstream version 4.2.2.10

Former-commit-id: 925376e1db46149d14f7949fcd7b08805ea8aba9
This commit is contained in:
Xamarin Public Jenkins
2015-12-18 19:40:30 -05:00
parent d11e8b35fd
commit 8cb7d04924
45 changed files with 399 additions and 122 deletions

View File

@@ -36,7 +36,10 @@ namespace System
return false;
var from = Type.GetTypeCode (source);
switch (Type.GetTypeCode (target)) {
var to = Type.GetTypeCode (target);
if (from == to && source.IsPrimitive)
return true;
switch (to) {
case TypeCode.Char:
switch (from) {
case TypeCode.Byte:
@@ -146,4 +149,4 @@ namespace System
return st == type || CanConvertPrimitive ((RuntimeType) st, type);
}
}
}
}

View File

@@ -102,17 +102,7 @@ namespace System
public MethodInfo Method {
get {
if (method_info != null) {
return method_info;
} else {
if (method != IntPtr.Zero) {
if (!method_is_virtual)
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
else
method_info = GetVirtualMethod_internal ();
}
return method_info;
}
return GetMethodImpl ();
}
}
@@ -511,7 +501,17 @@ namespace System
protected virtual MethodInfo GetMethodImpl ()
{
return Method;
if (method_info != null) {
return method_info;
} else {
if (method != IntPtr.Zero) {
if (!method_is_virtual)
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
else
method_info = GetVirtualMethod_internal ();
}
return method_info;
}
}
// This is from ISerializable

View File

@@ -33,6 +33,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
@@ -112,6 +113,14 @@ namespace System
return base.GetHashCode ();
}
protected override MethodInfo GetMethodImpl ()
{
if (delegates != null)
return delegates [delegates.Length - 1].Method;
return base.GetMethodImpl ();
}
// <summary>
// Return, in order of invocation, the invocation list
// of a MulticastDelegate

View File

@@ -855,6 +855,32 @@ namespace MonoTests.System.Threading
Assert.AreSame (Thread.GetNamedDataSlot ("te#st"), Thread.GetNamedDataSlot ("te#st"), "#2");
}
class DomainClass : MarshalByRefObject {
Thread m_thread;
bool success;
public bool Run () {
m_thread = new Thread(ThreadProc);
m_thread.Start(Thread.CurrentThread);
m_thread.Join();
return success;
}
public void ThreadProc (object arg) {
success = m_thread == Thread.CurrentThread;
}
}
[Test]
public void CurrentThread_Domains ()
{
AppDomain ad = AppDomain.CreateDomain ("foo");
ad.Load (typeof (DomainClass).Assembly.GetName ());
var o = (DomainClass)ad.CreateInstanceAndUnwrap (typeof (DomainClass).Assembly.FullName, typeof (DomainClass).FullName);
Assert.IsTrue (o.Run ());
AppDomain.Unload (ad);
}
void CheckIsRunning (string s, Thread t)
{
int c = counter;

View File

@@ -1 +1 @@
9f87bcd74d19a29f1b4e41b2d7171f2c1af2835c
bc4d15d32cfe0aba953847153e27ae46f18e35c1