Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / System.Threading.Tasks / TaskScheduler.cs
index 98c5c70327d4a7c445241686ceca3424880bfb25..a4031c0a50dbd3705fd9482eef6a57d8221c4c3d 100644 (file)
@@ -26,7 +26,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#if NET_4_0 || MOBILE
+#if NET_4_0
 
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -100,10 +100,16 @@ namespace System.Threading.Tasks
                                return id;
                        }
                }
+
+               internal static bool IsDefault {
+                       get {
+                               return currentScheduler == null || currentScheduler == defaultScheduler;
+                       }
+               }
                
                public virtual int MaximumConcurrencyLevel {
                        get {
-                               return Environment.ProcessorCount;
+                               return int.MaxValue;
                        }
                }
 
@@ -133,9 +139,9 @@ namespace System.Threading.Tasks
 
                protected abstract bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued);
 
-               internal bool RunInline (Task task)
+               internal bool RunInline (Task task, bool taskWasPreviouslyQueued)
                {
-                       if (!TryExecuteTaskInline (task, false))
+                       if (!TryExecuteTaskInline (task, taskWasPreviouslyQueued))
                                return false;
 
                        if (!task.IsCompleted)