{"action":"opened","number":3,"pull_request":{"url":"https://api.github.com/repos/yahoo/squidb/pulls/3","id":33567386,"html_url":"https://github.com/yahoo/squidb/pull/3","diff_url":"https://github.com/yahoo/squidb/pull/3.diff","patch_url":"https://github.com/yahoo/squidb/pull/3.patch","issue_url":"https://api.github.com/repos/yahoo/squidb/issues/3","number":3,"state":"open","locked":false,"title":"Better locking mechanism","user":{"login":"sbosley","id":622224,"avatar_url":"https://avatars.githubusercontent.com/u/622224?v=3","gravatar_id":"","url":"https://api.github.com/users/sbosley","html_url":"https://github.com/sbosley","followers_url":"https://api.github.com/users/sbosley/followers","following_url":"https://api.github.com/users/sbosley/following{/other_user}","gists_url":"https://api.github.com/users/sbosley/gists{/gist_id}","starred_url":"https://api.github.com/users/sbosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbosley/subscriptions","organizations_url":"https://api.github.com/users/sbosley/orgs","repos_url":"https://api.github.com/users/sbosley/repos","events_url":"https://api.github.com/users/sbosley/events{/privacy}","received_events_url":"https://api.github.com/users/sbosley/received_events","type":"User","site_admin":false},"body":"@sciolizer helpfully pointed out to me that I had re-invented a read/write lock with my locking mechanism for protecting attached databases. This replaces my cruder version of that locking with a ReentrantReadWriteLock, which is much simpler to understand and maintain.\r\n\r\nNote: it's important to remember that the lock is not actually protecting database reads and writes (both of those can use the read lock)--it's only for protecting exclusive access to the database connection for things like attaches. For that reason I've left the original method naming of \"exclusive\" and \"non-exclusive\" locks and documented how each should be used.","created_at":"2015-04-17T17:59:27Z","updated_at":"2015-04-17T17:59:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/squidb/pulls/3/commits","review_comments_url":"https://api.github.com/repos/yahoo/squidb/pulls/3/comments","review_comment_url":"https://api.github.com/repos/yahoo/squidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/squidb/issues/3/comments","statuses_url":"https://api.github.com/repos/yahoo/squidb/statuses/4a38cc14a818412e1d4113b6df1eb92c67b0e923","head":{"label":"sbosley:read_write_lock","ref":"read_write_lock","sha":"4a38cc14a818412e1d4113b6df1eb92c67b0e923","user":{"login":"sbosley","id":622224,"avatar_url":"https://avatars.githubusercontent.com/u/622224?v=3","gravatar_id":"","url":"https://api.github.com/users/sbosley","html_url":"https://github.com/sbosley","followers_url":"https://api.github.com/users/sbosley/followers","following_url":"https://api.github.com/users/sbosley/following{/other_user}","gists_url":"https://api.github.com/users/sbosley/gists{/gist_id}","starred_url":"https://api.github.com/users/sbosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbosley/subscriptions","organizations_url":"https://api.github.com/users/sbosley/orgs","repos_url":"https://api.github.com/users/sbosley/repos","events_url":"https://api.github.com/users/sbosley/events{/privacy}","received_events_url":"https://api.github.com/users/sbosley/received_events","type":"User","site_admin":false},"repo":{"id":34016211,"name":"squidb","full_name":"sbosley/squidb","owner":{"login":"sbosley","id":622224,"avatar_url":"https://avatars.githubusercontent.com/u/622224?v=3","gravatar_id":"","url":"https://api.github.com/users/sbosley","html_url":"https://github.com/sbosley","followers_url":"https://api.github.com/users/sbosley/followers","following_url":"https://api.github.com/users/sbosley/following{/other_user}","gists_url":"https://api.github.com/users/sbosley/gists{/gist_id}","starred_url":"https://api.github.com/users/sbosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbosley/subscriptions","organizations_url":"https://api.github.com/users/sbosley/orgs","repos_url":"https://api.github.com/users/sbosley/repos","events_url":"https://api.github.com/users/sbosley/events{/privacy}","received_events_url":"https://api.github.com/users/sbosley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbosley/squidb","description":"SquiDB is a SQLite database layer for Android","fork":true,"url":"https://api.github.com/repos/sbosley/squidb","forks_url":"https://api.github.com/repos/sbosley/squidb/forks","keys_url":"https://api.github.com/repos/sbosley/squidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbosley/squidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbosley/squidb/teams","hooks_url":"https://api.github.com/repos/sbosley/squidb/hooks","issue_events_url":"https://api.github.com/repos/sbosley/squidb/issues/events{/number}","events_url":"https://api.github.com/repos/sbosley/squidb/events","assignees_url":"https://api.github.com/repos/sbosley/squidb/assignees{/user}","branches_url":"https://api.github.com/repos/sbosley/squidb/branches{/branch}","tags_url":"https://api.github.com/repos/sbosley/squidb/tags","blobs_url":"https://api.github.com/repos/sbosley/squidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbosley/squidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbosley/squidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbosley/squidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbosley/squidb/statuses/{sha}","languages_url":"https://api.github.com/repos/sbosley/squidb/languages","stargazers_url":"https://api.github.com/repos/sbosley/squidb/stargazers","contributors_url":"https://api.github.com/repos/sbosley/squidb/contributors","subscribers_url":"https://api.github.com/repos/sbosley/squidb/subscribers","subscription_url":"https://api.github.com/repos/sbosley/squidb/subscription","commits_url":"https://api.github.com/repos/sbosley/squidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbosley/squidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbosley/squidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbosley/squidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbosley/squidb/contents/{+path}","compare_url":"https://api.github.com/repos/sbosley/squidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbosley/squidb/merges","archive_url":"https://api.github.com/repos/sbosley/squidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbosley/squidb/downloads","issues_url":"https://api.github.com/repos/sbosley/squidb/issues{/number}","pulls_url":"https://api.github.com/repos/sbosley/squidb/pulls{/number}","milestones_url":"https://api.github.com/repos/sbosley/squidb/milestones{/number}","notifications_url":"https://api.github.com/repos/sbosley/squidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbosley/squidb/labels{/name}","releases_url":"https://api.github.com/repos/sbosley/squidb/releases{/id}","created_at":"2015-04-15T20:13:50Z","updated_at":"2015-04-17T16:13:44Z","pushed_at":"2015-04-17T17:58:12Z","git_url":"git://github.com/sbosley/squidb.git","ssh_url":"git@github.com:sbosley/squidb.git","clone_url":"https://github.com/sbosley/squidb.git","svn_url":"https://github.com/sbosley/squidb","homepage":"https://github.com/yahoo/squidb/wiki","size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"yahoo:master","ref":"master","sha":"ec6255c696a518cd168127c33e0ee761e7c964d5","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":34006895,"name":"squidb","full_name":"yahoo/squidb","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/squidb","description":"SquiDB is a SQLite database layer for Android","fork":false,"url":"https://api.github.com/repos/yahoo/squidb","forks_url":"https://api.github.com/repos/yahoo/squidb/forks","keys_url":"https://api.github.com/repos/yahoo/squidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/squidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/squidb/teams","hooks_url":"https://api.github.com/repos/yahoo/squidb/hooks","issue_events_url":"https://api.github.com/repos/yahoo/squidb/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/squidb/events","assignees_url":"https://api.github.com/repos/yahoo/squidb/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/squidb/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/squidb/tags","blobs_url":"https://api.github.com/repos/yahoo/squidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/squidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/squidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/squidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/squidb/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/squidb/languages","stargazers_url":"https://api.github.com/repos/yahoo/squidb/stargazers","contributors_url":"https://api.github.com/repos/yahoo/squidb/contributors","subscribers_url":"https://api.github.com/repos/yahoo/squidb/subscribers","subscription_url":"https://api.github.com/repos/yahoo/squidb/subscription","commits_url":"https://api.github.com/repos/yahoo/squidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/squidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/squidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/squidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/squidb/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/squidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/squidb/merges","archive_url":"https://api.github.com/repos/yahoo/squidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/squidb/downloads","issues_url":"https://api.github.com/repos/yahoo/squidb/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/squidb/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/squidb/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/squidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/squidb/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/squidb/releases{/id}","created_at":"2015-04-15T16:54:33Z","updated_at":"2015-04-17T16:12:28Z","pushed_at":"2015-04-17T16:12:28Z","git_url":"git://github.com/yahoo/squidb.git","ssh_url":"git@github.com:yahoo/squidb.git","clone_url":"https://github.com/yahoo/squidb.git","svn_url":"https://github.com/yahoo/squidb","homepage":"https://github.com/yahoo/squidb/wiki","size":0,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/squidb/pulls/3"},"html":{"href":"https://github.com/yahoo/squidb/pull/3"},"issue":{"href":"https://api.github.com/repos/yahoo/squidb/issues/3"},"comments":{"href":"https://api.github.com/repos/yahoo/squidb/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/squidb/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/squidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/squidb/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/squidb/statuses/4a38cc14a818412e1d4113b6df1eb92c67b0e923"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":99,"deletions":122,"changed_files":3}}