[runtime] Implement 'nursery-canaries' option for SGen.
authorAlexis Christoforides <alexis@thenull.net>
Mon, 6 Oct 2014 05:32:53 +0000 (22:32 -0700)
committerAlexis Christoforides <alexis@thenull.net>
Mon, 6 Oct 2014 05:32:53 +0000 (22:32 -0700)
mcs/class/System.XML/System.Xml/XmlTextReader.cs
mcs/class/System.XML/System.Xml/XmlTextReader2.cs
mcs/class/corlib/System.Threading.Tasks/Task.cs
mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs
mono/mini/cpu-arm.md

index 63745fe3039117b51b56597d695550427ad8fa24..7dc686ba352503d26971f59ec116cd78b7971f91 100644 (file)
@@ -164,11 +164,6 @@ namespace Mono.Xml2
                        InitializeContext (url, context, fragment, fragType);
                }
 
-               Uri ResolveUri (string url)
-               {
-                       return resolver == null ? null : resolver.ResolveUri (null, url);
-               }
-
                Stream GetStreamFromUrl (string url, out string absoluteUriString)
                {
 #if NET_2_1
@@ -177,9 +172,13 @@ namespace Mono.Xml2
                        if (url.Length == 0)
                                throw new ArgumentException ("url");
 #endif
-                       Uri uri = ResolveUri (url);
+                       //
+                       // This needs to work even if resolver is explicitly set to null
+                       //
+                       var res = resolver ?? new XmlUrlResolver ();
+                       var uri = res.ResolveUri (null, url);
                        absoluteUriString = uri != null ? uri.ToString () : String.Empty;
-                       return resolver == null ? null : resolver.GetEntity (uri, null, typeof (Stream)) as Stream;
+                       return res.GetEntity (uri, null, typeof (Stream)) as Stream;
                }
 
                #endregion
index 2110bb62f17e0fbc51b3323dcef33b96073de5ba..52a7a9e687891f6a624ed2f77cc38787f7963e58 100644 (file)
@@ -254,6 +254,11 @@ namespace System.Xml
                        get { return entity != null ? ReadState.Interactive : source.ReadState; }
                }
 
+#if NET_4_0
+               [MonoTODO]
+               public DtdProcessing DtdProcessing { get; set; }
+#endif
+
 #if !NET_4_5
                public override XmlReaderSettings Settings {
                        get { return base.Settings; }
index 1f8165a0d480712cad9b3affb89b3ab076376147..4f4abd33e9cd8365c7919c890e59d3f4acf04a8e 100644 (file)
@@ -635,7 +635,7 @@ namespace System.Threading.Tasks
                
                #region Cancel and Wait related method
                
-               internal void CancelReal ()
+               internal void CancelReal (bool notifyParent = false)
                {
                        Status = TaskStatus.Canceled;
 
@@ -643,6 +643,9 @@ namespace System.Threading.Tasks
                                wait_handle.Set ();
 
                        ProcessCompleteDelegates ();
+
+                       if (notifyParent && parent != null && NotifyParentOnFinish ())
+                               parent = null;
                }
 
                void HandleGenericException (Exception e)
index 2a0547850bd044fd65d53eea6bd251ea3ea5aad9..8ede25eebe4f4c81e23bc67e0583afb05b444ee6 100644 (file)
@@ -94,7 +94,7 @@ namespace System.Threading.Tasks
                public void Execute ()
                {
                        if (!ContinuationStatusCheck (continuationOptions)) {
-                               task.CancelReal ();
+                               task.CancelReal (notifyParent : true);
                                task.Dispose ();
                                return;
                        }
index 63eb8a2aff1a8b31d9b64fe0b40193d0a3a0430f..1c391f6b08a98ae02f23d7fdd832d85a4fe83c07 100644 (file)
@@ -616,18 +616,18 @@ namespace MonoTests.System.Threading.Tasks
                public void ContinueWithChildren ()
                {
                        ParallelTestHelper.Repeat (delegate {
-                           bool result = false;
+                               bool result = false;
 
-                           var t = Task.Factory.StartNew (() => Task.Factory.StartNew (() => {}, TaskCreationOptions.AttachedToParent));
+                               var t = Task.Factory.StartNew (() => Task.Factory.StartNew (() => {}, TaskCreationOptions.AttachedToParent));
 
                                var mre = new ManualResetEvent (false);
-                           t.ContinueWith (l => {
+                               t.ContinueWith (l => {
                                        result = true;
                                        mre.Set ();
                                });
 
                                Assert.IsTrue (mre.WaitOne (1000), "#1");
-                           Assert.IsTrue (result, "#2");
+                               Assert.IsTrue (result, "#2");
                        }, 2);
                }
 
@@ -1094,7 +1094,7 @@ namespace MonoTests.System.Threading.Tasks
                        var t = new Task (() => {
                                new Task (() => { r1 = true; }, TaskCreationOptions.AttachedToParent).RunSynchronously ();
                                Task.Factory.StartNew (() => { Thread.Sleep (100); r2 = true; }, TaskCreationOptions.AttachedToParent);
-                   });
+                       });
                        t.RunSynchronously ();
 
                        Assert.IsTrue (r1);
@@ -1932,6 +1932,24 @@ namespace MonoTests.System.Threading.Tasks
                        }
                }
 
+               [Test]
+               public void ChildTaskWithUnscheduledContinuationAttachedToParent ()
+               {
+                       Task inner = null;
+                       var child = Task.Factory.StartNew (() => {
+                               inner  = Task.Run (() => {
+                                       throw new ApplicationException ();
+                               }).ContinueWith (task => { }, TaskContinuationOptions.AttachedToParent | TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.ExecuteSynchronously);
+                       });
+
+                       int counter = 0;
+                       var t = child.ContinueWith (t2 => ++counter, TaskContinuationOptions.ExecuteSynchronously);
+                       Assert.IsTrue (t.Wait (5000), "#1");
+                       Assert.AreEqual (1, counter, "#2");
+                       Assert.AreEqual (TaskStatus.RanToCompletion, child.Status, "#3");
+                       Assert.AreEqual (TaskStatus.Canceled, inner.Status, "#4");
+               }
+
                [Test]
                [Category("NotWorking")]
                public void TaskContinuationChainLeak()
index 6fd40d92c3aa26b61ae9da2e2dabfae638f9dee6..b31b368ec78550d7442a76009225d42d64bf7873 100644 (file)
@@ -211,7 +211,7 @@ sbb_imm: dest:i src1:i len:12
 br_reg: src1:i len:8
 bigmul: len:8 dest:l src1:i src2:i
 bigmul_un: len:8 dest:l src1:i src2:i
-tls_get: len:20 dest:i clob:c
+tls_get: len:24 dest:i clob:c
 
 # 32 bit opcodes
 int_add: dest:i src1:i src2:i len:4