{"action":"created","comment":{"url":"https://api.github.com/repos/kaazing/netx.ws/pulls/comments/29400208","id":29400208,"diff_hunk":"@@ -0,0 +1,70 @@\n+/*\n+ * Copyright 2014, Kaazing Corporation. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.kaazing.netx.ws.internal.util;\n+\n+import java.util.concurrent.atomic.AtomicInteger;\n+import java.util.concurrent.atomic.AtomicReference;\n+\n+// ### TODO: 1. happens-before relationship should be established between the thread that releases the lock and the next thread\n+//              that acquires the lock.\n+//           2. Evaluate using Martin's sun.misc.Unsafe based AtomicSequence implementation.\n+public class OptimisticReentrantLock {","path":"src/main/java/org/kaazing/netx/ws/internal/util/OptimisticReentrantLock.java","position":24,"original_position":24,"commit_id":"10191665e4118f7103bc107f136a7c0595b7784a","original_commit_id":"10191665e4118f7103bc107f136a7c0595b7784a","user":{"login":"sanjay-saxena","id":7605221,"avatar_url":"https://avatars.githubusercontent.com/u/7605221?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjay-saxena","html_url":"https://github.com/sanjay-saxena","followers_url":"https://api.github.com/users/sanjay-saxena/followers","following_url":"https://api.github.com/users/sanjay-saxena/following{/other_user}","gists_url":"https://api.github.com/users/sanjay-saxena/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjay-saxena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjay-saxena/subscriptions","organizations_url":"https://api.github.com/users/sanjay-saxena/orgs","repos_url":"https://api.github.com/users/sanjay-saxena/repos","events_url":"https://api.github.com/users/sanjay-saxena/events{/privacy}","received_events_url":"https://api.github.com/users/sanjay-saxena/received_events","type":"User","site_admin":false},"body":"I was not planning on implementing fairness as it is not free -- http://www.ibm.com/developerworks/library/j-jtp10264/. \r\n\r\nIf we think that we should implement fairness, then we can use `AtomicReferenceArray` with an initial size. If the number of threads increases the initial size, then we can create a new instance of `AtomicReferenceArrray` and copy the contents of the old instance into the new instance.","created_at":"2015-04-30T02:39:32Z","updated_at":"2015-04-30T02:39:32Z","html_url":"https://github.com/kaazing/netx.ws/pull/12#discussion_r29400208","pull_request_url":"https://api.github.com/repos/kaazing/netx.ws/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/comments/29400208"},"html":{"href":"https://github.com/kaazing/netx.ws/pull/12#discussion_r29400208"},"pull_request":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/kaazing/netx.ws/pulls/12","id":34330215,"html_url":"https://github.com/kaazing/netx.ws/pull/12","diff_url":"https://github.com/kaazing/netx.ws/pull/12.diff","patch_url":"https://github.com/kaazing/netx.ws/pull/12.patch","issue_url":"https://api.github.com/repos/kaazing/netx.ws/issues/12","number":12,"state":"open","locked":false,"title":"Changes for making netx.ws thread-safe","user":{"login":"sanjay-saxena","id":7605221,"avatar_url":"https://avatars.githubusercontent.com/u/7605221?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjay-saxena","html_url":"https://github.com/sanjay-saxena","followers_url":"https://api.github.com/users/sanjay-saxena/followers","following_url":"https://api.github.com/users/sanjay-saxena/following{/other_user}","gists_url":"https://api.github.com/users/sanjay-saxena/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjay-saxena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjay-saxena/subscriptions","organizations_url":"https://api.github.com/users/sanjay-saxena/orgs","repos_url":"https://api.github.com/users/sanjay-saxena/repos","events_url":"https://api.github.com/users/sanjay-saxena/events{/privacy}","received_events_url":"https://api.github.com/users/sanjay-saxena/received_events","type":"User","site_admin":false},"body":"Thread-safe implementation of netx.ws that is garbage-free and wait-free.","created_at":"2015-04-29T02:55:45Z","updated_at":"2015-04-30T02:39:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6ad1bb73f70880772a81266c5295d572af53395","assignee":{"login":"jfallows","id":2099911,"avatar_url":"https://avatars.githubusercontent.com/u/2099911?v=3","gravatar_id":"","url":"https://api.github.com/users/jfallows","html_url":"https://github.com/jfallows","followers_url":"https://api.github.com/users/jfallows/followers","following_url":"https://api.github.com/users/jfallows/following{/other_user}","gists_url":"https://api.github.com/users/jfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/jfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfallows/subscriptions","organizations_url":"https://api.github.com/users/jfallows/orgs","repos_url":"https://api.github.com/users/jfallows/repos","events_url":"https://api.github.com/users/jfallows/events{/privacy}","received_events_url":"https://api.github.com/users/jfallows/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kaazing/netx.ws/pulls/12/commits","review_comments_url":"https://api.github.com/repos/kaazing/netx.ws/pulls/12/comments","review_comment_url":"https://api.github.com/repos/kaazing/netx.ws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaazing/netx.ws/issues/12/comments","statuses_url":"https://api.github.com/repos/kaazing/netx.ws/statuses/10191665e4118f7103bc107f136a7c0595b7784a","head":{"label":"sanjay-saxena:develop","ref":"develop","sha":"10191665e4118f7103bc107f136a7c0595b7784a","user":{"login":"sanjay-saxena","id":7605221,"avatar_url":"https://avatars.githubusercontent.com/u/7605221?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjay-saxena","html_url":"https://github.com/sanjay-saxena","followers_url":"https://api.github.com/users/sanjay-saxena/followers","following_url":"https://api.github.com/users/sanjay-saxena/following{/other_user}","gists_url":"https://api.github.com/users/sanjay-saxena/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjay-saxena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjay-saxena/subscriptions","organizations_url":"https://api.github.com/users/sanjay-saxena/orgs","repos_url":"https://api.github.com/users/sanjay-saxena/repos","events_url":"https://api.github.com/users/sanjay-saxena/events{/privacy}","received_events_url":"https://api.github.com/users/sanjay-saxena/received_events","type":"User","site_admin":false},"repo":{"id":30737028,"name":"netx.ws","full_name":"sanjay-saxena/netx.ws","owner":{"login":"sanjay-saxena","id":7605221,"avatar_url":"https://avatars.githubusercontent.com/u/7605221?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjay-saxena","html_url":"https://github.com/sanjay-saxena","followers_url":"https://api.github.com/users/sanjay-saxena/followers","following_url":"https://api.github.com/users/sanjay-saxena/following{/other_user}","gists_url":"https://api.github.com/users/sanjay-saxena/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjay-saxena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjay-saxena/subscriptions","organizations_url":"https://api.github.com/users/sanjay-saxena/orgs","repos_url":"https://api.github.com/users/sanjay-saxena/repos","events_url":"https://api.github.com/users/sanjay-saxena/events{/privacy}","received_events_url":"https://api.github.com/users/sanjay-saxena/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanjay-saxena/netx.ws","description":"WebSocket RFC-6455 implementation (Java6+)","fork":true,"url":"https://api.github.com/repos/sanjay-saxena/netx.ws","forks_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/forks","keys_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/teams","hooks_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/hooks","issue_events_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/issues/events{/number}","events_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/events","assignees_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/assignees{/user}","branches_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/branches{/branch}","tags_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/tags","blobs_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/statuses/{sha}","languages_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/languages","stargazers_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/stargazers","contributors_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/contributors","subscribers_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/subscribers","subscription_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/subscription","commits_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/contents/{+path}","compare_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/merges","archive_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/downloads","issues_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/issues{/number}","pulls_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/pulls{/number}","milestones_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/milestones{/number}","notifications_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/labels{/name}","releases_url":"https://api.github.com/repos/sanjay-saxena/netx.ws/releases{/id}","created_at":"2015-02-13T02:42:12Z","updated_at":"2015-04-28T05:37:04Z","pushed_at":"2015-04-28T05:37:04Z","git_url":"git://github.com/sanjay-saxena/netx.ws.git","ssh_url":"git@github.com:sanjay-saxena/netx.ws.git","clone_url":"https://github.com/sanjay-saxena/netx.ws.git","svn_url":"https://github.com/sanjay-saxena/netx.ws","homepage":"","size":899,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"kaazing:develop","ref":"develop","sha":"9bff001903ef284eb69e9e2957c6647a04b4c3b6","user":{"login":"kaazing","id":1056680,"avatar_url":"https://avatars.githubusercontent.com/u/1056680?v=3","gravatar_id":"","url":"https://api.github.com/users/kaazing","html_url":"https://github.com/kaazing","followers_url":"https://api.github.com/users/kaazing/followers","following_url":"https://api.github.com/users/kaazing/following{/other_user}","gists_url":"https://api.github.com/users/kaazing/gists{/gist_id}","starred_url":"https://api.github.com/users/kaazing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaazing/subscriptions","organizations_url":"https://api.github.com/users/kaazing/orgs","repos_url":"https://api.github.com/users/kaazing/repos","events_url":"https://api.github.com/users/kaazing/events{/privacy}","received_events_url":"https://api.github.com/users/kaazing/received_events","type":"Organization","site_admin":false},"repo":{"id":29266927,"name":"netx.ws","full_name":"kaazing/netx.ws","owner":{"login":"kaazing","id":1056680,"avatar_url":"https://avatars.githubusercontent.com/u/1056680?v=3","gravatar_id":"","url":"https://api.github.com/users/kaazing","html_url":"https://github.com/kaazing","followers_url":"https://api.github.com/users/kaazing/followers","following_url":"https://api.github.com/users/kaazing/following{/other_user}","gists_url":"https://api.github.com/users/kaazing/gists{/gist_id}","starred_url":"https://api.github.com/users/kaazing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaazing/subscriptions","organizations_url":"https://api.github.com/users/kaazing/orgs","repos_url":"https://api.github.com/users/kaazing/repos","events_url":"https://api.github.com/users/kaazing/events{/privacy}","received_events_url":"https://api.github.com/users/kaazing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaazing/netx.ws","description":"WebSocket RFC-6455 implementation (Java6+)","fork":false,"url":"https://api.github.com/repos/kaazing/netx.ws","forks_url":"https://api.github.com/repos/kaazing/netx.ws/forks","keys_url":"https://api.github.com/repos/kaazing/netx.ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaazing/netx.ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaazing/netx.ws/teams","hooks_url":"https://api.github.com/repos/kaazing/netx.ws/hooks","issue_events_url":"https://api.github.com/repos/kaazing/netx.ws/issues/events{/number}","events_url":"https://api.github.com/repos/kaazing/netx.ws/events","assignees_url":"https://api.github.com/repos/kaazing/netx.ws/assignees{/user}","branches_url":"https://api.github.com/repos/kaazing/netx.ws/branches{/branch}","tags_url":"https://api.github.com/repos/kaazing/netx.ws/tags","blobs_url":"https://api.github.com/repos/kaazing/netx.ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaazing/netx.ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaazing/netx.ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaazing/netx.ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaazing/netx.ws/statuses/{sha}","languages_url":"https://api.github.com/repos/kaazing/netx.ws/languages","stargazers_url":"https://api.github.com/repos/kaazing/netx.ws/stargazers","contributors_url":"https://api.github.com/repos/kaazing/netx.ws/contributors","subscribers_url":"https://api.github.com/repos/kaazing/netx.ws/subscribers","subscription_url":"https://api.github.com/repos/kaazing/netx.ws/subscription","commits_url":"https://api.github.com/repos/kaazing/netx.ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaazing/netx.ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaazing/netx.ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaazing/netx.ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaazing/netx.ws/contents/{+path}","compare_url":"https://api.github.com/repos/kaazing/netx.ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaazing/netx.ws/merges","archive_url":"https://api.github.com/repos/kaazing/netx.ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaazing/netx.ws/downloads","issues_url":"https://api.github.com/repos/kaazing/netx.ws/issues{/number}","pulls_url":"https://api.github.com/repos/kaazing/netx.ws/pulls{/number}","milestones_url":"https://api.github.com/repos/kaazing/netx.ws/milestones{/number}","notifications_url":"https://api.github.com/repos/kaazing/netx.ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaazing/netx.ws/labels{/name}","releases_url":"https://api.github.com/repos/kaazing/netx.ws/releases{/id}","created_at":"2015-01-14T21:33:45Z","updated_at":"2015-04-23T20:40:18Z","pushed_at":"2015-04-29T02:55:46Z","git_url":"git://github.com/kaazing/netx.ws.git","ssh_url":"git@github.com:kaazing/netx.ws.git","clone_url":"https://github.com/kaazing/netx.ws.git","svn_url":"https://github.com/kaazing/netx.ws","homepage":"","size":1092,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/12"},"html":{"href":"https://github.com/kaazing/netx.ws/pull/12"},"issue":{"href":"https://api.github.com/repos/kaazing/netx.ws/issues/12"},"comments":{"href":"https://api.github.com/repos/kaazing/netx.ws/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaazing/netx.ws/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/kaazing/netx.ws/statuses/10191665e4118f7103bc107f136a7c0595b7784a"}}}}