{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/reactive/pulls/comments/194333395","pull_request_review_id":127482741,"id":194333395,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDMzMzM5NQ==","diff_hunk":"@@ -47,32 +53,43 @@ public void Run(IObservable<TFirst> first, IObservable<TSecond> second)\n                 {\n                     _gate = new object();\n \n-                    var fstSubscription = new SingleAssignmentDisposable();\n-                    var sndSubscription = new SingleAssignmentDisposable();\n+                    firstObserver = new FirstObserver(this);\n+                    secondObserver = new SecondObserver(this);\n \n-                    var fstO = new FirstObserver(this, fstSubscription);\n-                    var sndO = new SecondObserver(this, sndSubscription);\n+                    firstObserver.Other = secondObserver;\n+                    secondObserver.Other = firstObserver;\n \n-                    fstO.Other = sndO;\n-                    sndO.Other = fstO;\n+                    Disposable.SetSingle(ref firstDisposable, first.SubscribeSafe(firstObserver));\n+                    Disposable.SetSingle(ref secondDisposable, second.SubscribeSafe(secondObserver));\n+                }\n \n-                    fstSubscription.Disposable = first.SubscribeSafe(fstO);\n-                    sndSubscription.Disposable = second.SubscribeSafe(sndO);\n+                protected override void Dispose(bool disposing)\n+                {\n+                    if (disposing)\n+                    {\n+                        Disposable.TryDispose(ref firstDisposable);\n+                        Disposable.TryDispose(ref secondDisposable);\n \n-                    SetUpstream(StableCompositeDisposable.Create(fstSubscription, sndSubscription, fstO, sndO));\n+                        // clearing the queue should happen under the lock\n+                        // as they are plain Queue<T>s, not concurrent queues.\n+                        lock (_gate)","path":"Rx.NET/Source/src/System.Reactive/Linq/Observable/Zip.cs","position":45,"original_position":45,"commit_id":"958f84f48dcce79912626edf059864b51b640bbd","original_commit_id":"958f84f48dcce79912626edf059864b51b640bbd","user":{"login":"danielcweber","id":1899410,"node_id":"MDQ6VXNlcjE4OTk0MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1899410?v=4","gravatar_id":"","url":"https://api.github.com/users/danielcweber","html_url":"https://github.com/danielcweber","followers_url":"https://api.github.com/users/danielcweber/followers","following_url":"https://api.github.com/users/danielcweber/following{/other_user}","gists_url":"https://api.github.com/users/danielcweber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielcweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielcweber/subscriptions","organizations_url":"https://api.github.com/users/danielcweber/orgs","repos_url":"https://api.github.com/users/danielcweber/repos","events_url":"https://api.github.com/users/danielcweber/events{/privacy}","received_events_url":"https://api.github.com/users/danielcweber/received_events","type":"User","site_admin":false},"body":"This has now become dangerous, _gate might not be assigned.","created_at":"2018-06-11T08:57:05Z","updated_at":"2018-06-11T08:57:05Z","html_url":"https://github.com/dotnet/reactive/pull/580#discussion_r194333395","pull_request_url":"https://api.github.com/repos/dotnet/reactive/pulls/580","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/comments/194333395"},"html":{"href":"https://github.com/dotnet/reactive/pull/580#discussion_r194333395"},"pull_request":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/580"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/reactive/pulls/580","id":193772146,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNzcyMTQ2","html_url":"https://github.com/dotnet/reactive/pull/580","diff_url":"https://github.com/dotnet/reactive/pull/580.diff","patch_url":"https://github.com/dotnet/reactive/pull/580.patch","issue_url":"https://api.github.com/repos/dotnet/reactive/issues/580","number":580,"state":"open","locked":false,"title":"4.x: Inline Disposable.Create","user":{"login":"akarnokd","id":1269832,"node_id":"MDQ6VXNlcjEyNjk4MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1269832?v=4","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"body":"This PR inlines the `Disposable.Create(Action)` invocations, saving on an allocation and some indirection.","created_at":"2018-06-09T11:07:42Z","updated_at":"2018-06-11T08:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f932f783043b0a67382a8837dcb4847af107d51","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/reactive/pulls/580/commits","review_comments_url":"https://api.github.com/repos/dotnet/reactive/pulls/580/comments","review_comment_url":"https://api.github.com/repos/dotnet/reactive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/reactive/issues/580/comments","statuses_url":"https://api.github.com/repos/dotnet/reactive/statuses/958f84f48dcce79912626edf059864b51b640bbd","head":{"label":"akarnokd:DisposableCreateInline","ref":"DisposableCreateInline","sha":"958f84f48dcce79912626edf059864b51b640bbd","user":{"login":"akarnokd","id":1269832,"node_id":"MDQ6VXNlcjEyNjk4MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1269832?v=4","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"repo":{"id":65015379,"node_id":"MDEwOlJlcG9zaXRvcnk2NTAxNTM3OQ==","name":"Rx.NET","full_name":"akarnokd/Rx.NET","owner":{"login":"akarnokd","id":1269832,"node_id":"MDQ6VXNlcjEyNjk4MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1269832?v=4","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akarnokd/Rx.NET","description":"The Reactive Extensions for .NET","fork":true,"url":"https://api.github.com/repos/akarnokd/Rx.NET","forks_url":"https://api.github.com/repos/akarnokd/Rx.NET/forks","keys_url":"https://api.github.com/repos/akarnokd/Rx.NET/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akarnokd/Rx.NET/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akarnokd/Rx.NET/teams","hooks_url":"https://api.github.com/repos/akarnokd/Rx.NET/hooks","issue_events_url":"https://api.github.com/repos/akarnokd/Rx.NET/issues/events{/number}","events_url":"https://api.github.com/repos/akarnokd/Rx.NET/events","assignees_url":"https://api.github.com/repos/akarnokd/Rx.NET/assignees{/user}","branches_url":"https://api.github.com/repos/akarnokd/Rx.NET/branches{/branch}","tags_url":"https://api.github.com/repos/akarnokd/Rx.NET/tags","blobs_url":"https://api.github.com/repos/akarnokd/Rx.NET/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akarnokd/Rx.NET/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akarnokd/Rx.NET/git/refs{/sha}","trees_url":"https://api.github.com/repos/akarnokd/Rx.NET/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akarnokd/Rx.NET/statuses/{sha}","languages_url":"https://api.github.com/repos/akarnokd/Rx.NET/languages","stargazers_url":"https://api.github.com/repos/akarnokd/Rx.NET/stargazers","contributors_url":"https://api.github.com/repos/akarnokd/Rx.NET/contributors","subscribers_url":"https://api.github.com/repos/akarnokd/Rx.NET/subscribers","subscription_url":"https://api.github.com/repos/akarnokd/Rx.NET/subscription","commits_url":"https://api.github.com/repos/akarnokd/Rx.NET/commits{/sha}","git_commits_url":"https://api.github.com/repos/akarnokd/Rx.NET/git/commits{/sha}","comments_url":"https://api.github.com/repos/akarnokd/Rx.NET/comments{/number}","issue_comment_url":"https://api.github.com/repos/akarnokd/Rx.NET/issues/comments{/number}","contents_url":"https://api.github.com/repos/akarnokd/Rx.NET/contents/{+path}","compare_url":"https://api.github.com/repos/akarnokd/Rx.NET/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akarnokd/Rx.NET/merges","archive_url":"https://api.github.com/repos/akarnokd/Rx.NET/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akarnokd/Rx.NET/downloads","issues_url":"https://api.github.com/repos/akarnokd/Rx.NET/issues{/number}","pulls_url":"https://api.github.com/repos/akarnokd/Rx.NET/pulls{/number}","milestones_url":"https://api.github.com/repos/akarnokd/Rx.NET/milestones{/number}","notifications_url":"https://api.github.com/repos/akarnokd/Rx.NET/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akarnokd/Rx.NET/labels{/name}","releases_url":"https://api.github.com/repos/akarnokd/Rx.NET/releases{/id}","deployments_url":"https://api.github.com/repos/akarnokd/Rx.NET/deployments","created_at":"2016-08-05T12:02:35Z","updated_at":"2018-05-28T21:59:36Z","pushed_at":"2018-06-09T11:05:23Z","git_url":"git://github.com/akarnokd/Rx.NET.git","ssh_url":"git@github.com:akarnokd/Rx.NET.git","clone_url":"https://github.com/akarnokd/Rx.NET.git","svn_url":"https://github.com/akarnokd/Rx.NET","homepage":"http://reactivex.io","size":30195,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"d76c0b36f891fcc876bcc5293295108b7f1b6f1e","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":12576526,"node_id":"MDEwOlJlcG9zaXRvcnkxMjU3NjUyNg==","name":"reactive","full_name":"dotnet/reactive","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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/reactive","description":"The Reactive Extensions for .NET","fork":false,"url":"https://api.github.com/repos/dotnet/reactive","forks_url":"https://api.github.com/repos/dotnet/reactive/forks","keys_url":"https://api.github.com/repos/dotnet/reactive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/reactive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/reactive/teams","hooks_url":"https://api.github.com/repos/dotnet/reactive/hooks","issue_events_url":"https://api.github.com/repos/dotnet/reactive/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/reactive/events","assignees_url":"https://api.github.com/repos/dotnet/reactive/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/reactive/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/reactive/tags","blobs_url":"https://api.github.com/repos/dotnet/reactive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/reactive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/reactive/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/reactive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/reactive/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/reactive/languages","stargazers_url":"https://api.github.com/repos/dotnet/reactive/stargazers","contributors_url":"https://api.github.com/repos/dotnet/reactive/contributors","subscribers_url":"https://api.github.com/repos/dotnet/reactive/subscribers","subscription_url":"https://api.github.com/repos/dotnet/reactive/subscription","commits_url":"https://api.github.com/repos/dotnet/reactive/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/reactive/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/reactive/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/reactive/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/reactive/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/reactive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/reactive/merges","archive_url":"https://api.github.com/repos/dotnet/reactive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/reactive/downloads","issues_url":"https://api.github.com/repos/dotnet/reactive/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/reactive/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/reactive/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/reactive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/reactive/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/reactive/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/reactive/deployments","created_at":"2013-09-03T22:33:51Z","updated_at":"2018-06-11T08:00:00Z","pushed_at":"2018-06-09T11:07:43Z","git_url":"git://github.com/dotnet/reactive.git","ssh_url":"git@github.com:dotnet/reactive.git","clone_url":"https://github.com/dotnet/reactive.git","svn_url":"https://github.com/dotnet/reactive","homepage":"http://reactivex.io","size":37442,"stargazers_count":2765,"watchers_count":2765,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":408,"mirror_url":null,"archived":false,"open_issues_count":130,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":408,"open_issues":130,"watchers":2765,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/580"},"html":{"href":"https://github.com/dotnet/reactive/pull/580"},"issue":{"href":"https://api.github.com/repos/dotnet/reactive/issues/580"},"comments":{"href":"https://api.github.com/repos/dotnet/reactive/issues/580/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/580/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/reactive/pulls/580/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/reactive/statuses/958f84f48dcce79912626edf059864b51b640bbd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"danielcweber"}}