Hi, Reported as: https://bugzilla.xamarin.com/show_bug.cgi?id=35828 Zoltan
On Thu, Nov 12, 2015 at 12:42 PM, Martin Potter <martin.pot...@faithlife.com > wrote: > We have some code which works on Microsoft’s runtime and used to work on > Mono 3.12, but now fails on Mono 4.2. Simplified code to reproduce the > issue is as follows: > > public class WorkStateThread > { > public void Start() > { > m_thread = new Thread(ThreadProc); > m_thread.Start(Thread.CurrentThread); > m_thread.Join(); > } > > private void ThreadProc (object objData) > { > if (m_thread != Thread.CurrentThread) > throw new InvalidOperationException ("m_thread != Thread.CurrentThread"); > } > > Thread m_thread; > } > > class MainClass > { > public static void Main (string[] args) > { > WorkStateThread ws = new WorkStateThread (); > ws.Start (); > Console.WriteLine ("Done"); > } > } > > [TestFixture] > public class Test > { > [Test] > public void TestCase () > { > WorkStateThread ws = new WorkStateThread (); > ws.Start (); > } > } > > This code runs as expected when run from the command line, but if run as > part of a unit test using NUnit, the InvalidOperationException is thrown. > > — Martin > > _______________________________________________ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > >
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list