Commit Graph
156 Commits
Author SHA1 Message Date
Marek Safar f39cc88e58 [corlib] Notify parent task when child task uses NotOnFaulted. Fixes #23594 2014-10-05 14:36:05 -04:00
Marek Safar ebcc2ee853 [corlib] Task never is CompletedSynchronously 2014-08-20 12:01:42 +02:00
Marek Safar a10df86558 [corlib] Better checks for release of parent task 2014-04-08 15:31:53 +02:00
BrandonLWhite 5e5f3a19fd Fixed memory leak in Task when child tasks are continually created.
This resolves bug # 18398 and other OOM scenarios in long running applications that make use of FromAsync, ContinueWith, etc. to "rearm" asynchronous operations.
2014-04-08 15:31:52 +02:00
Marek Safar 4b4ddb66b3 [corlib] Improve flow of ExecutionContext (few tests taken from https://github.com/mono/mono/pull/864). Fixes #18121 and similar. 2014-03-06 19:54:06 +01:00
Marek Safar 1383b1834d [corlib] Better recovery when tasks run on broken scheduler 2014-02-06 18:08:37 +01:00
Marek Safar 8f1a0ccce6 [corlib] Improve 85aaf9b074 change 2014-01-14 19:23:23 +01:00
Marek Safar e83bf13866 [corlib] Mark all promise-style task exceptions observed. Fixes #17015 2014-01-06 17:52:19 +01:00
Marek Safar 99aa6cf9b2 [corlib] Promise style tasks cannot be started manually. Fixes #16857 2014-01-02 14:13:00 +01:00
Marek Safar de61f61d53 [corlib] Keep original cancellation exception from awaited task 2013-12-08 10:42:12 +01:00
Marek Safar 85aaf9b074 [corlib] Better handling of awaiter continuation on finished task 2013-12-07 19:51:36 +01:00
Marek Safar 3b664f331f [corlib] Implement task awaiters running on custom task scheduler. Fixes #16587 2013-12-05 09:51:56 +01:00
Marek Safar a2850fc7da Merge pull request #799 from kebby/master
Task.WhenAllCore<T> now handles empty argument list correctly. Fixes #15956
2013-11-12 00:38:48 -08:00
Tammo 'kb' Hinrichs 9fce6c603c Return empty result array when calling Task.WhenAllCore<T> with empty argument list. Fixes #15956 2013-11-06 13:21:47 +01:00
Marek Safar e5bd8bc98b Release continuation ancestor before running. Fixes #15036 2013-10-09 10:43:41 +02:00
Marek Safar cf2ac2171b Make Task.Delay more reliable. Fixes #14585 2013-10-08 10:16:19 +02:00
Marek Safar 354027fe22 Schedule internal delay task on default scheduler only. Fixes #13318 2013-07-20 09:18:58 +02:00
Marek Safar b65deac489 Remove redundant status capturing 2013-07-16 10:13:27 +02:00
Marek Safar 20aaf27c90 Fixes scheduling of non-inlined sychronous continuations. 2013-07-16 10:00:15 +02:00
Marek Safar 7e7134d3c6 Block task awaiter until task completes. Fixes #12745 2013-06-27 16:02:07 +02:00
Rodrigo Kumpera f8b3c4142f Kill some unused code that is a leftover from when TPL had a managed scheduler. 2013-06-13 18:50:01 -04:00
Marek Safar 8b7cf63dd3 Implement Task::AsyncWaitHandle. Fixes #12342 2013-05-23 11:11:25 +02:00
Marek Safar 46fc054c3f Remove internal continuations from unfinished tasks used in WhenAny, Fixes #11008 2013-03-18 09:33:06 +01:00
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