{"action":"closed","number":495,"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/495","id":27583814,"html_url":"https://github.com/citra-emu/citra/pull/495","diff_url":"https://github.com/citra-emu/citra/pull/495.diff","patch_url":"https://github.com/citra-emu/citra/pull/495.patch","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/495","number":495,"state":"closed","locked":false,"title":"Fix WaitSynchronization","user":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"body":"Complete rewrite of WaitSynchronization1/WaitSynchronizationN. Basically, with our previous implementation, WaitSynchronizationN was entirely broken (this PR fixes #469). This required some pretty massive refactoring, which actually greatly simplified a lot of code. This is a very large change, so I would appreciate a pretty in-depth code review (especially for silly C++ mistakes), as well as extensive testing. However, my usual test suite of homebrew and retail works fine. I also wrote a quite extensive addition to hwtests to validate my implementation (that of which now passes), and as such I'm fairly confident that the implementations of these functions are now pretty sufficiently correct (PR for hwtests to follow once I clean it up). Please let me know if you have any interesting ideas for test cases that might break this implementation :) A quick overview of changes:\r\n* Created a WaitObject type for Kernel objects that can wait the current thread via WaitSynchronization, and changed relevant Kernel objects to inherit from it\r\n* Got rid of WaitType's (legacy code from PPSSPP that made no sense here)\r\n* Split up object's WaitSynchronization method into Wait and Aquire methods\r\n* Implemented WaitSynchronizationN with wait_all=true\r\n* Implemented WaitSynchronizationN with wait_all=false (i.e. \"select\")\r\n* Implemented timeouts with WaitSynchronizationN\r\n* Fixed output values for WaitSynchronizationN if the current thread waited\r\n* Fixed a bug in Mutex\r\n* Fixed several bugs in Event\r\n* ...I'm sure many more things\r\n\r\nEDIT: Please don't review commit by commit, some design decisions changed over time :( And sorry, I'm very likely not going to redo the commit history just for this.","created_at":"2015-01-19T03:50:51Z","updated_at":"2015-01-22T02:09:47Z","closed_at":"2015-01-22T02:09:47Z","merged_at":"2015-01-22T02:09:47Z","merge_commit_sha":"f01ce7ca39c027d85807cae160ab709729eeb765","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/citra-emu/citra/pulls/495/commits","review_comments_url":"https://api.github.com/repos/citra-emu/citra/pulls/495/comments","review_comment_url":"https://api.github.com/repos/citra-emu/citra/pulls/comments/{number}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/495/comments","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/731154f79e4f2e417a9db97e125eadb26b6b6f06","head":{"label":"bunnei:fix-waitsynch","ref":"fix-waitsynch","sha":"731154f79e4f2e417a9db97e125eadb26b6b6f06","user":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"repo":{"id":19964905,"name":"citra","full_name":"bunnei/citra","owner":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bunnei/citra","description":"Nintendo 3DS emulator/debugger","fork":true,"url":"https://api.github.com/repos/bunnei/citra","forks_url":"https://api.github.com/repos/bunnei/citra/forks","keys_url":"https://api.github.com/repos/bunnei/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bunnei/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bunnei/citra/teams","hooks_url":"https://api.github.com/repos/bunnei/citra/hooks","issue_events_url":"https://api.github.com/repos/bunnei/citra/issues/events{/number}","events_url":"https://api.github.com/repos/bunnei/citra/events","assignees_url":"https://api.github.com/repos/bunnei/citra/assignees{/user}","branches_url":"https://api.github.com/repos/bunnei/citra/branches{/branch}","tags_url":"https://api.github.com/repos/bunnei/citra/tags","blobs_url":"https://api.github.com/repos/bunnei/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bunnei/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bunnei/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/bunnei/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bunnei/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/bunnei/citra/languages","stargazers_url":"https://api.github.com/repos/bunnei/citra/stargazers","contributors_url":"https://api.github.com/repos/bunnei/citra/contributors","subscribers_url":"https://api.github.com/repos/bunnei/citra/subscribers","subscription_url":"https://api.github.com/repos/bunnei/citra/subscription","commits_url":"https://api.github.com/repos/bunnei/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/bunnei/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/bunnei/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/bunnei/citra/issues/comments/{number}","contents_url":"https://api.github.com/repos/bunnei/citra/contents/{+path}","compare_url":"https://api.github.com/repos/bunnei/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bunnei/citra/merges","archive_url":"https://api.github.com/repos/bunnei/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bunnei/citra/downloads","issues_url":"https://api.github.com/repos/bunnei/citra/issues{/number}","pulls_url":"https://api.github.com/repos/bunnei/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/bunnei/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/bunnei/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bunnei/citra/labels{/name}","releases_url":"https://api.github.com/repos/bunnei/citra/releases{/id}","created_at":"2014-05-20T02:28:14Z","updated_at":"2015-01-04T07:46:55Z","pushed_at":"2015-01-22T01:55:09Z","git_url":"git://github.com/bunnei/citra.git","ssh_url":"git@github.com:bunnei/citra.git","clone_url":"https://github.com/bunnei/citra.git","svn_url":"https://github.com/bunnei/citra","homepage":null,"size":7958,"stargazers_count":45,"watchers_count":45,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":0,"forks":11,"open_issues":0,"watchers":45,"default_branch":"master"}},"base":{"label":"citra-emu:master","ref":"master","sha":"0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6","user":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"repo":{"id":19866730,"name":"citra","full_name":"citra-emu/citra","owner":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/citra-emu/citra","description":"Nintendo 3DS emulator/debugger","fork":false,"url":"https://api.github.com/repos/citra-emu/citra","forks_url":"https://api.github.com/repos/citra-emu/citra/forks","keys_url":"https://api.github.com/repos/citra-emu/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citra-emu/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citra-emu/citra/teams","hooks_url":"https://api.github.com/repos/citra-emu/citra/hooks","issue_events_url":"https://api.github.com/repos/citra-emu/citra/issues/events{/number}","events_url":"https://api.github.com/repos/citra-emu/citra/events","assignees_url":"https://api.github.com/repos/citra-emu/citra/assignees{/user}","branches_url":"https://api.github.com/repos/citra-emu/citra/branches{/branch}","tags_url":"https://api.github.com/repos/citra-emu/citra/tags","blobs_url":"https://api.github.com/repos/citra-emu/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citra-emu/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citra-emu/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/citra-emu/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/citra-emu/citra/languages","stargazers_url":"https://api.github.com/repos/citra-emu/citra/stargazers","contributors_url":"https://api.github.com/repos/citra-emu/citra/contributors","subscribers_url":"https://api.github.com/repos/citra-emu/citra/subscribers","subscription_url":"https://api.github.com/repos/citra-emu/citra/subscription","commits_url":"https://api.github.com/repos/citra-emu/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/citra-emu/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/citra-emu/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/citra-emu/citra/issues/comments/{number}","contents_url":"https://api.github.com/repos/citra-emu/citra/contents/{+path}","compare_url":"https://api.github.com/repos/citra-emu/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citra-emu/citra/merges","archive_url":"https://api.github.com/repos/citra-emu/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citra-emu/citra/downloads","issues_url":"https://api.github.com/repos/citra-emu/citra/issues{/number}","pulls_url":"https://api.github.com/repos/citra-emu/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/citra-emu/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/citra-emu/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citra-emu/citra/labels{/name}","releases_url":"https://api.github.com/repos/citra-emu/citra/releases{/id}","created_at":"2014-05-16T18:33:15Z","updated_at":"2015-01-21T23:36:47Z","pushed_at":"2015-01-22T02:09:48Z","git_url":"git://github.com/citra-emu/citra.git","ssh_url":"git@github.com:citra-emu/citra.git","clone_url":"https://github.com/citra-emu/citra.git","svn_url":"https://github.com/citra-emu/citra","homepage":null,"size":17090,"stargazers_count":512,"watchers_count":512,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":45,"forks":130,"open_issues":45,"watchers":512,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/495"},"html":{"href":"https://github.com/citra-emu/citra/pull/495"},"issue":{"href":"https://api.github.com/repos/citra-emu/citra/issues/495"},"comments":{"href":"https://api.github.com/repos/citra-emu/citra/issues/495/comments"},"review_comments":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/495/comments"},"review_comment":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/495/commits"},"statuses":{"href":"https://api.github.com/repos/citra-emu/citra/statuses/731154f79e4f2e417a9db97e125eadb26b6b6f06"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"comments":4,"review_comments":68,"commits":27,"additions":476,"deletions":373,"changed_files":15}}