Commit Graph
133 Commits
Author SHA1 Message Date
Marek Safar c1437f237f Fix TaskCreationOptions.AttachedToParent to avoid NRE on TaskCreationOptions.DenyChildAttach and deadlock on Wait 2013-02-12 14:25:58 +01:00
Marek Safar 65518ad2ca RunSynchronously cannot be used with continuation 2013-02-12 14:25:58 +01:00
Rodrigo Kumpera 1b92a4148c Since MOBILE implies NET_4_* now, take this into account and simplify our ifdefs. 2013-02-11 18:42:18 -05:00
Marek Safar 5b177dfc0a Run async continuation without allocating temporary hoisting classes. 2013-01-03 18:40:01 +01:00
Jeremie Laval e7f4360ad3 [corlib] Fix unobserved exception being mistakenly propagated to finalizer thread when using ContinueWhenAll.
The problem was that we internally use Task.WhenAll inside TaskFactory.ContinueWhenAll to merge the given tasks into one that we can Continue on to run the passed arguments.

However, the behavior of WhenAll is to collect the exceptions that happened on its parent tasks and to set the aggregate on itself which was not catched by our continuation internally, leading to the exception remaining unobserved and escalating to the finalizer thread.
2012-11-15 15:01:32 +00:00
Jeremie Laval 077589883d [corlib] Fix 4.0 build 2012-09-24 16:28:49 +01:00
Jeremie Laval 3b2d269943 [corlib] Fix build 2012-09-24 16:19:56 +01:00
Jeremie Laval 5877a9423b [corlib] Honor LazyCancellation flag 2012-09-24 12:28:25 +01:00
Jeremie Laval 2de1ee29c8 [corlib] Honor HideScheduler flag 2012-09-24 11:47:06 +01:00
Jeremie Laval 2ce078ba52 [corlib] Honor DenyChildAttach flag 2012-09-24 11:21:45 +01:00
Jeremie Laval 0b5eddeaff [corlib] Make Task.Run specify TaskScheduler.Default and fix Task.Run (Task<Task>) 2012-09-24 11:11:46 +01:00
Marek Safar 455b845157 Fix scheduling of inlined tasks. 2012-05-30 12:08:08 +01:00
Marek Safar c23a7f49d1 Fix task delay tests 2012-04-20 16:12:41 +01:00
Jeremie Laval fa8a7b41b8 Fix Task child waiting for RunSynchronously 2012-04-16 12:38:00 +01:00
Jeremie Laval 3fe545acdb Change how parent is selected during Task creation and do not force continuation's parent as they are not necessarily the same as their ancestor 2012-04-16 12:38:00 +01:00
Jeremie Laval 366aa16f08 Don't overwrite the current variable without first saving its value in case a Task is executed inline inside another task 2012-04-13 20:11:03 +01:00
Jeremie Laval a3ed8990eb Correctly propagate faulted status and exception from child to parent in attached case 2012-04-13 17:25:48 +01:00
Jeremie Laval a221409ade Use .NET 4.5 implementation of Task's WhenAll/WhenAny for TaskFactory's ContinueWhenAll/ContinueWhenAny
The diff noise in Task.cs is just moving WhenAllCore and WhenAnyCore outside of their NET_4_5 region
2012-04-10 16:37:25 +01:00
Marek Safar 35ca4a994f Implement more Task 4.5 members 2012-04-05 11:21:42 +01:00
Marek Safar e6b35a697d Hide internal member 2012-04-04 10:38:20 +01:00
Marek Safar 40c3a4c5f2 Implement Task::WhenAll 2012-04-04 10:38:20 +01:00
Marek Safar b1683b85d3 Remove some unused code 2012-02-24 13:14:08 +00:00
Jérémie Laval eea2894929 Fix RunSynchronously behavior with children Task. Fix bug #2777 part 2. 2012-02-03 15:38:15 +01:00
Jérémie Laval e325ea3653 Fix Task AttachedToParent behavior. Fix bug #2777 part1.
The problem was two folds. First, a parent task wasn't correctly waiting on the inner task continuations that were setup. Second, the way the Task parent field was re-used with a continuation collided with the parenting behavior of AttachedToParent (if the continuation was also created that way), the fix is to have two Task fields to differentiate between the two cases.
2012-02-03 03:56:18 +01:00
Marek Safar 0a66e607fc Remove never used Task::Execute parameter 2011-10-29 13:35:01 +01:00
Marek Safar 772bff3244 Move TrySet method from TaskCompletionSource to Task, so AsyncTaskMethodBuilder can act as secondary TaskCompletionSource implementation 2011-10-27 11:03:38 +01:00
Jeremie Laval 5a78256af1 Run unobserved task exception processing on the finalizer thread but without the need for a finalizer in Task 2011-10-26 12:32:37 +02:00
Jeremie Laval 52299fb467 Use only one class hierarchy for task continuations 2011-10-22 12:01:30 +02:00
Marek Safar 596a6c5542 Implement ContinueWhenAny/ContinueWhenAll with less temporary tasks 2011-10-21 16:26:11 +01:00
Marek Safar 469ad8cb81 Setup await continuation without extra task 2011-10-21 15:49:44 +01:00
Marek Safar adb5835775 Create Task continuation with less intermediate delegates 2011-10-21 10:00:53 +01:00
Jeremie Laval 63de171090 Add a memory barrier after each status change 2011-10-20 14:02:31 +02:00
Jeremie Laval 6acce5e34a Move Thread.MemoryBarrier call into Task for every case 2011-10-20 13:38:40 +02:00
Marek Safar 81a14dc9be Don't run expensive WaitAll when there is nothing to wait for 2011-10-17 14:28:28 +01:00
Jérémie Laval 00238873c1 Move files around 2011-10-15 19:48:54 +02:00
Jérémie Laval 80fe94e7a1 First take at an updated Task.WaitAll 2011-10-15 19:34:40 +02:00
Jérémie Laval 931f0e510e Insert the unregister call in the finally handler too 2011-10-15 16:35:01 +02:00
Jérémie Laval 3a427c424a Clean event registration when wait is unsuccessful 2011-10-15 15:34:56 +02:00
Jérémie Laval 5d867bb1cf Ensure there is no mutually exclusive TaskContinuationOptions parameters when registering continuations 2011-10-15 15:34:55 +02:00
Jérémie Laval adfffa4c5b Remove schedWait event since it's not needed anymore by waiting code 2011-10-15 15:34:54 +02:00
Jérémie Laval df8783a082 Update Wait and WaitAny with event disposal and single execution flow 2011-10-14 14:50:53 +02:00
Jérémie Laval 898387ea75 Don't special casee adding a TaskCanceledException to the AggregateException list 2011-10-14 13:51:44 +02:00
Jérémie Laval abf938e98a Make IsCompleted property faster by doing only one comparison 2011-10-14 13:51:00 +02:00
Jérémie Laval 8ae8031bfb Refactor Wait* task initial parameter checkup 2011-10-14 13:50:16 +02:00
Jérémie Laval 9e8175ffcf Don't fallback to Wait in WaitAny so that undesirable exception aren't propagated 2011-10-14 11:18:36 +02:00
Jérémie Laval a9b5c59e94 Cache watch usage 2011-10-13 22:09:00 +02:00
Jérémie Laval ec7a3894d5 Fix stuff then went awry with the merge 2011-10-13 22:04:18 +02:00
Jérémie Laval 4770b24fa9 Tune Marek's work on Task.WaitAny, Task.Wait and Task.WaitAll 2011-10-13 21:42:21 +02:00
Marek Safar 67ea246398 Fix a race in Task.WaitAny 2011-10-13 19:16:10 +01:00
Marek Safar a3d97ba5df Fixes Task.WaitAny with further fixes to Task.Wait 2011-10-13 17:35:00 +01:00