{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/34406772","id":34406772,"diff_hunk":"@@ -0,0 +1,73 @@\n+﻿using System.Collections;\n+using System.Collections.Generic;\n+\n+namespace Test\n+{\n+    internal class ThrowOnEnumeration<T> : IEnumerable<T>","path":"src/System.Linq.Parallel/tests/Helpers/Enumerables.cs","position":6,"original_position":6,"commit_id":"2afcbfdf26290e64f42b4d059b6316e2a6f76def","original_commit_id":"2afcbfdf26290e64f42b4d059b6316e2a6f76def","user":{"login":"Clockwork-Muse","id":5569508,"avatar_url":"https://avatars.githubusercontent.com/u/5569508?v=3","gravatar_id":"","url":"https://api.github.com/users/Clockwork-Muse","html_url":"https://github.com/Clockwork-Muse","followers_url":"https://api.github.com/users/Clockwork-Muse/followers","following_url":"https://api.github.com/users/Clockwork-Muse/following{/other_user}","gists_url":"https://api.github.com/users/Clockwork-Muse/gists{/gist_id}","starred_url":"https://api.github.com/users/Clockwork-Muse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clockwork-Muse/subscriptions","organizations_url":"https://api.github.com/users/Clockwork-Muse/orgs","repos_url":"https://api.github.com/users/Clockwork-Muse/repos","events_url":"https://api.github.com/users/Clockwork-Muse/events{/privacy}","received_events_url":"https://api.github.com/users/Clockwork-Muse/received_events","type":"User","site_admin":false},"body":"Yeah.  At this point it was \"yes/no?\".","created_at":"2015-07-11T00:23:40Z","updated_at":"2015-07-11T00:23:40Z","html_url":"https://github.com/dotnet/corefx/pull/2307#discussion_r34406772","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/2307","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/34406772"},"html":{"href":"https://github.com/dotnet/corefx/pull/2307#discussion_r34406772"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2307"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/2307","id":39678927,"html_url":"https://github.com/dotnet/corefx/pull/2307","diff_url":"https://github.com/dotnet/corefx/pull/2307.diff","patch_url":"https://github.com/dotnet/corefx/pull/2307.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/2307","number":2307,"state":"open","locked":false,"title":"PLINQ - immediate cancellation of ToArray","user":{"login":"Clockwork-Muse","id":5569508,"avatar_url":"https://avatars.githubusercontent.com/u/5569508?v=3","gravatar_id":"","url":"https://api.github.com/users/Clockwork-Muse","html_url":"https://github.com/Clockwork-Muse","followers_url":"https://api.github.com/users/Clockwork-Muse/followers","following_url":"https://api.github.com/users/Clockwork-Muse/following{/other_user}","gists_url":"https://api.github.com/users/Clockwork-Muse/gists{/gist_id}","starred_url":"https://api.github.com/users/Clockwork-Muse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clockwork-Muse/subscriptions","organizations_url":"https://api.github.com/users/Clockwork-Muse/orgs","repos_url":"https://api.github.com/users/Clockwork-Muse/repos","events_url":"https://api.github.com/users/Clockwork-Muse/events{/privacy}","received_events_url":"https://api.github.com/users/Clockwork-Muse/received_events","type":"User","site_admin":false},"body":"All the query operators have a check for whether they've already been canceled - except `ToArray` (well, and `SequenceEqual`, but that's a different problem).  `ToArray` calls a different method than the other query operators, and it appears to be missing the pre-emptive cancellation check - the methods are otherwise mostly identical.  This change adds the check.\r\n\r\nCurrent behavior of `ToArray` in such a situation is to fire off the worker threads, which each perform one enumeration before checking for cancellation.  This change would prevent the worker threads from being started, so _may_ change use cases for some people.  Note that some operations (`SelectMany`, binaries) already perform the pre-emptive check anyways before enumerating a source, so the current behavior is very much dependent on what consumers call.\r\n\r\n(besides the required discussion, will need to be rebased to account for other PRs I've submitted).","created_at":"2015-07-10T12:22:22Z","updated_at":"2015-07-11T00:23:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be62fbb62818e82ff71440be97ff2b8cb9435eec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/2307/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/2307/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/2307/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/2afcbfdf26290e64f42b4d059b6316e2a6f76def","head":{"label":"Clockwork-Muse:PLINQ_ArrayCancelImmediate","ref":"PLINQ_ArrayCancelImmediate","sha":"2afcbfdf26290e64f42b4d059b6316e2a6f76def","user":{"login":"Clockwork-Muse","id":5569508,"avatar_url":"https://avatars.githubusercontent.com/u/5569508?v=3","gravatar_id":"","url":"https://api.github.com/users/Clockwork-Muse","html_url":"https://github.com/Clockwork-Muse","followers_url":"https://api.github.com/users/Clockwork-Muse/followers","following_url":"https://api.github.com/users/Clockwork-Muse/following{/other_user}","gists_url":"https://api.github.com/users/Clockwork-Muse/gists{/gist_id}","starred_url":"https://api.github.com/users/Clockwork-Muse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clockwork-Muse/subscriptions","organizations_url":"https://api.github.com/users/Clockwork-Muse/orgs","repos_url":"https://api.github.com/users/Clockwork-Muse/repos","events_url":"https://api.github.com/users/Clockwork-Muse/events{/privacy}","received_events_url":"https://api.github.com/users/Clockwork-Muse/received_events","type":"User","site_admin":false},"repo":{"id":29805465,"name":"corefx","full_name":"Clockwork-Muse/corefx","owner":{"login":"Clockwork-Muse","id":5569508,"avatar_url":"https://avatars.githubusercontent.com/u/5569508?v=3","gravatar_id":"","url":"https://api.github.com/users/Clockwork-Muse","html_url":"https://github.com/Clockwork-Muse","followers_url":"https://api.github.com/users/Clockwork-Muse/followers","following_url":"https://api.github.com/users/Clockwork-Muse/following{/other_user}","gists_url":"https://api.github.com/users/Clockwork-Muse/gists{/gist_id}","starred_url":"https://api.github.com/users/Clockwork-Muse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clockwork-Muse/subscriptions","organizations_url":"https://api.github.com/users/Clockwork-Muse/orgs","repos_url":"https://api.github.com/users/Clockwork-Muse/repos","events_url":"https://api.github.com/users/Clockwork-Muse/events{/privacy}","received_events_url":"https://api.github.com/users/Clockwork-Muse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Clockwork-Muse/corefx","description":"Branch for issue #516.  WARNING - will be rebased often.","fork":true,"url":"https://api.github.com/repos/Clockwork-Muse/corefx","forks_url":"https://api.github.com/repos/Clockwork-Muse/corefx/forks","keys_url":"https://api.github.com/repos/Clockwork-Muse/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Clockwork-Muse/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Clockwork-Muse/corefx/teams","hooks_url":"https://api.github.com/repos/Clockwork-Muse/corefx/hooks","issue_events_url":"https://api.github.com/repos/Clockwork-Muse/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/Clockwork-Muse/corefx/events","assignees_url":"https://api.github.com/repos/Clockwork-Muse/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/Clockwork-Muse/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/Clockwork-Muse/corefx/tags","blobs_url":"https://api.github.com/repos/Clockwork-Muse/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Clockwork-Muse/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Clockwork-Muse/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Clockwork-Muse/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Clockwork-Muse/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/Clockwork-Muse/corefx/languages","stargazers_url":"https://api.github.com/repos/Clockwork-Muse/corefx/stargazers","contributors_url":"https://api.github.com/repos/Clockwork-Muse/corefx/contributors","subscribers_url":"https://api.github.com/repos/Clockwork-Muse/corefx/subscribers","subscription_url":"https://api.github.com/repos/Clockwork-Muse/corefx/subscription","commits_url":"https://api.github.com/repos/Clockwork-Muse/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Clockwork-Muse/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Clockwork-Muse/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Clockwork-Muse/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Clockwork-Muse/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/Clockwork-Muse/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Clockwork-Muse/corefx/merges","archive_url":"https://api.github.com/repos/Clockwork-Muse/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Clockwork-Muse/corefx/downloads","issues_url":"https://api.github.com/repos/Clockwork-Muse/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/Clockwork-Muse/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/Clockwork-Muse/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/Clockwork-Muse/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Clockwork-Muse/corefx/labels{/name}","releases_url":"https://api.github.com/repos/Clockwork-Muse/corefx/releases{/id}","created_at":"2015-01-25T06:35:53Z","updated_at":"2015-04-30T10:08:57Z","pushed_at":"2015-07-11T00:21:33Z","git_url":"git://github.com/Clockwork-Muse/corefx.git","ssh_url":"git@github.com:Clockwork-Muse/corefx.git","clone_url":"https://github.com/Clockwork-Muse/corefx.git","svn_url":"https://github.com/Clockwork-Muse/corefx","homepage":"","size":23918,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"fc250c1441b811c858aca2e0296f92b851a0a89c","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-07-10T18:31:48Z","pushed_at":"2015-07-11T00:11:06Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"http://dotnet.github.io/core/","size":50569,"stargazers_count":8028,"watchers_count":8028,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1662,"mirror_url":null,"open_issues_count":466,"forks":1662,"open_issues":466,"watchers":8028,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2307"},"html":{"href":"https://github.com/dotnet/corefx/pull/2307"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2307"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2307/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2307/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2307/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/2afcbfdf26290e64f42b4d059b6316e2a6f76def"}}}}