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

@ -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;