{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments/135898949","pull_request_review_id":59366262,"id":135898949,"diff_hunk":"@@ -974,33 +974,16 @@ namespace Microsoft.FSharp.Control\n             let tcs = new TaskCompletionSource<_>(taskCreationOptions)\n \n             // The contract: \n-            //      a) cancellation signal should always propagate to task\n-            //      b) CancellationTokenSource that produced a token must not be disposed until the task.IsComplete\n-            // We are:\n-            //      1) registering for cancellation signal here so that not to miss the signal\n-            //      2) disposing the registration just before setting result/exception on TaskCompletionSource -\n-            //              otherwise we run a chance of disposing registration on already disposed  CancellationTokenSource\n-            //              (See (b) above)\n-            //      3) ensuring if reg is disposed, we do SetResult\n-            let barrier = VolatileBarrier()\n-            let reg = token.Register(fun _ -> if barrier.Proceed then tcs.SetCanceled())\n+            //      a) cancellation signal should always propagate to the computation\n+            //      b) when the task IsCompleted -> nothing is running anymore\n             let task = tcs.Task\n-            let disposeReg() =\n-                barrier.Stop()\n-                if not (task.IsCanceled) then reg.Dispose()\n-\n-            let a = \n-                async { \n-                    try\n-                        let! result = computation\n-                        do \n-                            disposeReg()\n-                            tcs.TrySetResult(result) |> ignore\n-                    with exn -> \n-                        disposeReg()\n-                        tcs.TrySetException(exn) |> ignore\n-                }\n-            Start(token, a)\n+            queueAsync\n+                token\n+                (fun r -> tcs.SetResult r |> fake)\n+                (fun edi -> tcs.SetException edi.SourceException |> fake)","path":"src/fsharp/FSharp.Core/control.fs","position":36,"original_position":36,"commit_id":"2b902e5dc0277c8f2a38b36c2181c19cc8195be1","original_commit_id":"b89c0150736d019a6ba09320eec43de0a112335b","user":{"login":"matthid","id":1866463,"avatar_url":"https://avatars0.githubusercontent.com/u/1866463?v=4","gravatar_id":"","url":"https://api.github.com/users/matthid","html_url":"https://github.com/matthid","followers_url":"https://api.github.com/users/matthid/followers","following_url":"https://api.github.com/users/matthid/following{/other_user}","gists_url":"https://api.github.com/users/matthid/gists{/gist_id}","starred_url":"https://api.github.com/users/matthid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthid/subscriptions","organizations_url":"https://api.github.com/users/matthid/orgs","repos_url":"https://api.github.com/users/matthid/repos","events_url":"https://api.github.com/users/matthid/events{/privacy}","received_events_url":"https://api.github.com/users/matthid/received_events","type":"User","site_admin":false},"body":"is it worse than before?","created_at":"2017-08-29T20:13:22Z","updated_at":"2017-08-29T20:13:22Z","html_url":"https://github.com/Microsoft/visualfsharp/pull/3256#discussion_r135898949","pull_request_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments/135898949"},"html":{"href":"https://github.com/Microsoft/visualfsharp/pull/3256#discussion_r135898949"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256"}},"in_reply_to_id":135897930},"pull_request":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256","id":127339632,"html_url":"https://github.com/Microsoft/visualfsharp/pull/3256","diff_url":"https://github.com/Microsoft/visualfsharp/pull/3256.diff","patch_url":"https://github.com/Microsoft/visualfsharp/pull/3256.patch","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3256","number":3256,"state":"open","locked":false,"title":"Fix 3219 - make StartAsTask wait for cancellation to take effect on task","user":{"login":"matthid","id":1866463,"avatar_url":"https://avatars0.githubusercontent.com/u/1866463?v=4","gravatar_id":"","url":"https://api.github.com/users/matthid","html_url":"https://github.com/matthid","followers_url":"https://api.github.com/users/matthid/followers","following_url":"https://api.github.com/users/matthid/following{/other_user}","gists_url":"https://api.github.com/users/matthid/gists{/gist_id}","starred_url":"https://api.github.com/users/matthid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthid/subscriptions","organizations_url":"https://api.github.com/users/matthid/orgs","repos_url":"https://api.github.com/users/matthid/repos","events_url":"https://api.github.com/users/matthid/events{/privacy}","received_events_url":"https://api.github.com/users/matthid/received_events","type":"User","site_admin":false},"body":"This fixes that `StartAsTask` will not wait properly for cancellation to finish, see https://github.com/Microsoft/visualfsharp/issues/3219#issuecomment-310844300\r\n\r\n/cc @eiriktsarpalis ","created_at":"2017-06-24T18:54:59Z","updated_at":"2017-08-29T20:13:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe6f8c6985d06f08d61ac9ea174b2723cf80c244","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256/commits","review_comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256/comments","review_comment_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3256/comments","statuses_url":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/2b902e5dc0277c8f2a38b36c2181c19cc8195be1","head":{"label":"matthid:fix_3219","ref":"fix_3219","sha":"2b902e5dc0277c8f2a38b36c2181c19cc8195be1","user":{"login":"matthid","id":1866463,"avatar_url":"https://avatars0.githubusercontent.com/u/1866463?v=4","gravatar_id":"","url":"https://api.github.com/users/matthid","html_url":"https://github.com/matthid","followers_url":"https://api.github.com/users/matthid/followers","following_url":"https://api.github.com/users/matthid/following{/other_user}","gists_url":"https://api.github.com/users/matthid/gists{/gist_id}","starred_url":"https://api.github.com/users/matthid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthid/subscriptions","organizations_url":"https://api.github.com/users/matthid/orgs","repos_url":"https://api.github.com/users/matthid/repos","events_url":"https://api.github.com/users/matthid/events{/privacy}","received_events_url":"https://api.github.com/users/matthid/received_events","type":"User","site_admin":false},"repo":{"id":64695520,"name":"visualfsharp","full_name":"matthid/visualfsharp","owner":{"login":"matthid","id":1866463,"avatar_url":"https://avatars0.githubusercontent.com/u/1866463?v=4","gravatar_id":"","url":"https://api.github.com/users/matthid","html_url":"https://github.com/matthid","followers_url":"https://api.github.com/users/matthid/followers","following_url":"https://api.github.com/users/matthid/following{/other_user}","gists_url":"https://api.github.com/users/matthid/gists{/gist_id}","starred_url":"https://api.github.com/users/matthid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthid/subscriptions","organizations_url":"https://api.github.com/users/matthid/orgs","repos_url":"https://api.github.com/users/matthid/repos","events_url":"https://api.github.com/users/matthid/events{/privacy}","received_events_url":"https://api.github.com/users/matthid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthid/visualfsharp","description":"The Visual F# compiler and tools","fork":true,"url":"https://api.github.com/repos/matthid/visualfsharp","forks_url":"https://api.github.com/repos/matthid/visualfsharp/forks","keys_url":"https://api.github.com/repos/matthid/visualfsharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthid/visualfsharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthid/visualfsharp/teams","hooks_url":"https://api.github.com/repos/matthid/visualfsharp/hooks","issue_events_url":"https://api.github.com/repos/matthid/visualfsharp/issues/events{/number}","events_url":"https://api.github.com/repos/matthid/visualfsharp/events","assignees_url":"https://api.github.com/repos/matthid/visualfsharp/assignees{/user}","branches_url":"https://api.github.com/repos/matthid/visualfsharp/branches{/branch}","tags_url":"https://api.github.com/repos/matthid/visualfsharp/tags","blobs_url":"https://api.github.com/repos/matthid/visualfsharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthid/visualfsharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthid/visualfsharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthid/visualfsharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthid/visualfsharp/statuses/{sha}","languages_url":"https://api.github.com/repos/matthid/visualfsharp/languages","stargazers_url":"https://api.github.com/repos/matthid/visualfsharp/stargazers","contributors_url":"https://api.github.com/repos/matthid/visualfsharp/contributors","subscribers_url":"https://api.github.com/repos/matthid/visualfsharp/subscribers","subscription_url":"https://api.github.com/repos/matthid/visualfsharp/subscription","commits_url":"https://api.github.com/repos/matthid/visualfsharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthid/visualfsharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthid/visualfsharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthid/visualfsharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthid/visualfsharp/contents/{+path}","compare_url":"https://api.github.com/repos/matthid/visualfsharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthid/visualfsharp/merges","archive_url":"https://api.github.com/repos/matthid/visualfsharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthid/visualfsharp/downloads","issues_url":"https://api.github.com/repos/matthid/visualfsharp/issues{/number}","pulls_url":"https://api.github.com/repos/matthid/visualfsharp/pulls{/number}","milestones_url":"https://api.github.com/repos/matthid/visualfsharp/milestones{/number}","notifications_url":"https://api.github.com/repos/matthid/visualfsharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthid/visualfsharp/labels{/name}","releases_url":"https://api.github.com/repos/matthid/visualfsharp/releases{/id}","deployments_url":"https://api.github.com/repos/matthid/visualfsharp/deployments","created_at":"2016-08-01T19:28:37Z","updated_at":"2016-08-01T19:28:50Z","pushed_at":"2017-08-29T20:02:52Z","git_url":"git://github.com/matthid/visualfsharp.git","ssh_url":"git@github.com:matthid/visualfsharp.git","clone_url":"https://github.com/matthid/visualfsharp.git","svn_url":"https://github.com/matthid/visualfsharp","homepage":null,"size":99256,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":false,"has_projects":true,"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":"Microsoft:master","ref":"master","sha":"02b8e09c2b38e9e31517ffa8819bb350709405d7","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":29048891,"name":"visualfsharp","full_name":"Microsoft/visualfsharp","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/visualfsharp","description":"The Visual F# compiler and tools","fork":false,"url":"https://api.github.com/repos/Microsoft/visualfsharp","forks_url":"https://api.github.com/repos/Microsoft/visualfsharp/forks","keys_url":"https://api.github.com/repos/Microsoft/visualfsharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/visualfsharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/visualfsharp/teams","hooks_url":"https://api.github.com/repos/Microsoft/visualfsharp/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/events","assignees_url":"https://api.github.com/repos/Microsoft/visualfsharp/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/visualfsharp/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/visualfsharp/tags","blobs_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/visualfsharp/languages","stargazers_url":"https://api.github.com/repos/Microsoft/visualfsharp/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/visualfsharp/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/visualfsharp/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/visualfsharp/subscription","commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/visualfsharp/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/visualfsharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/visualfsharp/merges","archive_url":"https://api.github.com/repos/Microsoft/visualfsharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/visualfsharp/downloads","issues_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/visualfsharp/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/visualfsharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/visualfsharp/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/visualfsharp/deployments","created_at":"2015-01-10T05:58:43Z","updated_at":"2017-08-26T20:28:08Z","pushed_at":"2017-08-29T20:02:54Z","git_url":"git://github.com/Microsoft/visualfsharp.git","ssh_url":"git@github.com:Microsoft/visualfsharp.git","clone_url":"https://github.com/Microsoft/visualfsharp.git","svn_url":"https://github.com/Microsoft/visualfsharp","homepage":null,"size":99210,"stargazers_count":1107,"watchers_count":1107,"language":"F#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":296,"mirror_url":null,"open_issues_count":384,"forks":296,"open_issues":384,"watchers":1107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256"},"html":{"href":"https://github.com/Microsoft/visualfsharp/pull/3256"},"issue":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3256"},"comments":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3256/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/3256/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/2b902e5dc0277c8f2a38b36c2181c19cc8195be1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"matthid"}}