{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/38325101","id":38325101,"diff_hunk":"@@ -571,85 +569,32 @@ private void CaretPositionChanged(object sender, CaretPositionChangedEventArgs e\n \n         #region Active Code and Standard Input\n \n-        // TODO: What happens if multiple non-UI threads call this method? (https://github.com/dotnet/roslyn/issues/3984)\n         TextReader IInteractiveWindow.ReadStandardInput()\n         {\n             // shouldn't be called on the UI thread because we'll hang\n             RequiresNonUIThread();\n+            return ReadStandardInputAsync().GetAwaiter().GetResult();","path":"src/InteractiveWindow/Editor/InteractiveWindow.cs","position":56,"original_position":56,"commit_id":"bf28d6327ef2daacda1d3707e8549eda0bc82a4c","original_commit_id":"bf28d6327ef2daacda1d3707e8549eda0bc82a4c","user":{"login":"cston","id":10732005,"avatar_url":"https://avatars.githubusercontent.com/u/10732005?v=3","gravatar_id":"","url":"https://api.github.com/users/cston","html_url":"https://github.com/cston","followers_url":"https://api.github.com/users/cston/followers","following_url":"https://api.github.com/users/cston/following{/other_user}","gists_url":"https://api.github.com/users/cston/gists{/gist_id}","starred_url":"https://api.github.com/users/cston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cston/subscriptions","organizations_url":"https://api.github.com/users/cston/orgs","repos_url":"https://api.github.com/users/cston/repos","events_url":"https://api.github.com/users/cston/events{/privacy}","received_events_url":"https://api.github.com/users/cston/received_events","type":"User","site_admin":false},"body":"Is this different from ReadStandardInputAsync().Result?","created_at":"2015-08-31T15:43:17Z","updated_at":"2015-08-31T15:43:17Z","html_url":"https://github.com/dotnet/roslyn/pull/4880#discussion_r38325101","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/4880","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/38325101"},"html":{"href":"https://github.com/dotnet/roslyn/pull/4880#discussion_r38325101"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/4880"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/4880","id":43683426,"html_url":"https://github.com/dotnet/roslyn/pull/4880","diff_url":"https://github.com/dotnet/roslyn/pull/4880.diff","patch_url":"https://github.com/dotnet/roslyn/pull/4880.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/4880","number":4880,"state":"open","locked":false,"title":"Make ReadStandardInput thread-safe","user":{"login":"amcasey","id":10508071,"avatar_url":"https://avatars.githubusercontent.com/u/10508071?v=3","gravatar_id":"","url":"https://api.github.com/users/amcasey","html_url":"https://github.com/amcasey","followers_url":"https://api.github.com/users/amcasey/followers","following_url":"https://api.github.com/users/amcasey/following{/other_user}","gists_url":"https://api.github.com/users/amcasey/gists{/gist_id}","starred_url":"https://api.github.com/users/amcasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amcasey/subscriptions","organizations_url":"https://api.github.com/users/amcasey/orgs","repos_url":"https://api.github.com/users/amcasey/repos","events_url":"https://api.github.com/users/amcasey/events{/privacy}","received_events_url":"https://api.github.com/users/amcasey/received_events","type":"User","site_admin":false},"body":"```ReadStandardInput``` was one of the thorniest areas of the interactive\r\nwindow because it not only could but needed to be called on a non-UI\r\nthread (so it could block waiting for user input).  (In hindsight, it\r\nshould probably have been task-returning, but the interface is frozen now.\r\nI hope to introduce an async version in a subsequent change.)\r\n\r\nThe biggest change was moving the cleanup code - which tried to guess\r\nwhat had happened to the standard input session - to the individual\r\nmethods that terminate the session - clear, reset, and submit.  Now we\r\ndon't have to guess about what state the UI thread will be in when we\r\nregain access.\r\n\r\nBased on a suggestion from @tmat, I also eliminated the previous-state\r\nmechanism in favor of encoding the information in the state itself.  The\r\ncomplexity is basically the same, but this way we can have an explicit\r\nstate machine (i.e. we don't have to consider the previous-state variable\r\nbefore making a state transition).\r\n\r\nThere are still a few rough edges:\r\nhttps://github.com/dotnet/roslyn/issues/4879\r\nhttps://github.com/dotnet/roslyn/issues/4878\r\n\r\nSince our host doesn't currently support reading standard input, I tested\r\nthe code manually using PTVS.","created_at":"2015-08-29T00:06:04Z","updated_at":"2015-08-31T15:43:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"632a6065c75aa90050a8f3ba1804c942abaa936b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/4880/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/4880/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4880/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/bf28d6327ef2daacda1d3707e8549eda0bc82a4c","head":{"label":"amcasey:ReadStdIn","ref":"ReadStdIn","sha":"bf28d6327ef2daacda1d3707e8549eda0bc82a4c","user":{"login":"amcasey","id":10508071,"avatar_url":"https://avatars.githubusercontent.com/u/10508071?v=3","gravatar_id":"","url":"https://api.github.com/users/amcasey","html_url":"https://github.com/amcasey","followers_url":"https://api.github.com/users/amcasey/followers","following_url":"https://api.github.com/users/amcasey/following{/other_user}","gists_url":"https://api.github.com/users/amcasey/gists{/gist_id}","starred_url":"https://api.github.com/users/amcasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amcasey/subscriptions","organizations_url":"https://api.github.com/users/amcasey/orgs","repos_url":"https://api.github.com/users/amcasey/repos","events_url":"https://api.github.com/users/amcasey/events{/privacy}","received_events_url":"https://api.github.com/users/amcasey/received_events","type":"User","site_admin":false},"repo":{"id":30559373,"name":"roslyn","full_name":"amcasey/roslyn","owner":{"login":"amcasey","id":10508071,"avatar_url":"https://avatars.githubusercontent.com/u/10508071?v=3","gravatar_id":"","url":"https://api.github.com/users/amcasey","html_url":"https://github.com/amcasey","followers_url":"https://api.github.com/users/amcasey/followers","following_url":"https://api.github.com/users/amcasey/following{/other_user}","gists_url":"https://api.github.com/users/amcasey/gists{/gist_id}","starred_url":"https://api.github.com/users/amcasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amcasey/subscriptions","organizations_url":"https://api.github.com/users/amcasey/orgs","repos_url":"https://api.github.com/users/amcasey/repos","events_url":"https://api.github.com/users/amcasey/events{/privacy}","received_events_url":"https://api.github.com/users/amcasey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amcasey/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/amcasey/roslyn","forks_url":"https://api.github.com/repos/amcasey/roslyn/forks","keys_url":"https://api.github.com/repos/amcasey/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amcasey/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amcasey/roslyn/teams","hooks_url":"https://api.github.com/repos/amcasey/roslyn/hooks","issue_events_url":"https://api.github.com/repos/amcasey/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/amcasey/roslyn/events","assignees_url":"https://api.github.com/repos/amcasey/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/amcasey/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/amcasey/roslyn/tags","blobs_url":"https://api.github.com/repos/amcasey/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amcasey/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amcasey/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/amcasey/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amcasey/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/amcasey/roslyn/languages","stargazers_url":"https://api.github.com/repos/amcasey/roslyn/stargazers","contributors_url":"https://api.github.com/repos/amcasey/roslyn/contributors","subscribers_url":"https://api.github.com/repos/amcasey/roslyn/subscribers","subscription_url":"https://api.github.com/repos/amcasey/roslyn/subscription","commits_url":"https://api.github.com/repos/amcasey/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/amcasey/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/amcasey/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/amcasey/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/amcasey/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/amcasey/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amcasey/roslyn/merges","archive_url":"https://api.github.com/repos/amcasey/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amcasey/roslyn/downloads","issues_url":"https://api.github.com/repos/amcasey/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/amcasey/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/amcasey/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/amcasey/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amcasey/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/amcasey/roslyn/releases{/id}","created_at":"2015-02-09T21:27:09Z","updated_at":"2015-02-23T22:59:36Z","pushed_at":"2015-08-29T00:05:57Z","git_url":"git://github.com/amcasey/roslyn.git","ssh_url":"git@github.com:amcasey/roslyn.git","clone_url":"https://github.com/amcasey/roslyn.git","svn_url":"https://github.com/amcasey/roslyn","homepage":"","size":92651,"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":"1a25d5d1de40ff6124811226fe91857aed3daaea","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":29078997,"name":"roslyn","full_name":"dotnet/roslyn","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/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-08-31T13:05:58Z","pushed_at":"2015-08-31T07:07:32Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":178495,"stargazers_count":3118,"watchers_count":3118,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":722,"mirror_url":null,"open_issues_count":1405,"forks":722,"open_issues":1405,"watchers":3118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/4880"},"html":{"href":"https://github.com/dotnet/roslyn/pull/4880"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/4880"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/4880/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/4880/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/4880/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/bf28d6327ef2daacda1d3707e8549eda0bc82a4c"}}}}