{"action":"created","comment":{"url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/comments/66619587","id":66619587,"diff_hunk":"@@ -421,20 +422,31 @@ namespace hpx { namespace naming\n         ///////////////////////////////////////////////////////////////////////\n         std::int64_t replenish_credits(gid_type& gid)\n         {\n+            typedef std::unique_lock<gid_type::mutex_type> scoped_lock;\n+            scoped_lock l(gid);\n+            return replenish_credits_locked(l, gid);\n+        }\n+\n+        HPX_EXPORT std::int64_t replenish_credits_locked(\n+            std::unique_lock<gid_type::mutex_type>& l, gid_type& gid)\n+        {\n             std::int64_t added_credit = 0;\n \n-            {\n-                typedef std::unique_lock<gid_type::mutex_type> scoped_lock;\n-                scoped_lock l(gid);\n-                HPX_ASSERT(0 == get_credit_from_gid(gid));\n+            HPX_ASSERT(0 == get_credit_from_gid(gid));\n \n-                added_credit = naming::detail::fill_credit_for_gid(gid);\n-                naming::detail::set_credit_split_mask_for_gid(gid);\n-            }\n+            added_credit = naming::detail::fill_credit_for_gid(gid);\n+            naming::detail::set_credit_split_mask_for_gid(gid);\n \n             gid_type unlocked_gid = gid;        // strips lock-bit\n \n-            return agas::incref(unlocked_gid, added_credit);\n+            std::int64_t result = 0;\n+            {\n+                hpx::util::scoped_unlock<std::unique_lock<gid_type::mutex_type> >\n+                    ul(l);\n+                 result = agas::incref(unlocked_gid, added_credit);\n+            }\n+\n+            return result;","path":"src/runtime/naming/name.cpp","position":44,"original_position":44,"commit_id":"5dcf1dfa1cafc0ede7c42ab3824d538658812828","original_commit_id":"5dcf1dfa1cafc0ede7c42ab3824d538658812828","user":{"login":"hkaiser","id":568063,"avatar_url":"https://avatars.githubusercontent.com/u/568063?v=3","gravatar_id":"","url":"https://api.github.com/users/hkaiser","html_url":"https://github.com/hkaiser","followers_url":"https://api.github.com/users/hkaiser/followers","following_url":"https://api.github.com/users/hkaiser/following{/other_user}","gists_url":"https://api.github.com/users/hkaiser/gists{/gist_id}","starred_url":"https://api.github.com/users/hkaiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkaiser/subscriptions","organizations_url":"https://api.github.com/users/hkaiser/orgs","repos_url":"https://api.github.com/users/hkaiser/repos","events_url":"https://api.github.com/users/hkaiser/events{/privacy}","received_events_url":"https://api.github.com/users/hkaiser/received_events","type":"User","site_admin":false},"body":"What is the rationale for this set of changes? Is the function `replenish_credits_locked()` additioanlly called from elsewhere? From what I can see, the only effect of the change would be an additonal lock/unlock on the mutex.\r\n\r\nUnlocking the mutex for `agas::incref()` is a valid change, though. However there is no reson to re-lock the mutex afterwards.","created_at":"2016-06-10T14:14:21Z","updated_at":"2016-06-10T14:14:21Z","html_url":"https://github.com/STEllAR-GROUP/hpx/pull/2206#discussion_r66619587","pull_request_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206","_links":{"self":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/comments/66619587"},"html":{"href":"https://github.com/STEllAR-GROUP/hpx/pull/2206#discussion_r66619587"},"pull_request":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206"}}},"pull_request":{"url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206","id":73059103,"html_url":"https://github.com/STEllAR-GROUP/hpx/pull/2206","diff_url":"https://github.com/STEllAR-GROUP/hpx/pull/2206.diff","patch_url":"https://github.com/STEllAR-GROUP/hpx/pull/2206.patch","issue_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/2206","number":2206,"state":"open","locked":false,"title":"Call package_action::get_future before package_action::apply","user":{"login":"sithhell","id":53655,"avatar_url":"https://avatars.githubusercontent.com/u/53655?v=3","gravatar_id":"","url":"https://api.github.com/users/sithhell","html_url":"https://github.com/sithhell","followers_url":"https://api.github.com/users/sithhell/followers","following_url":"https://api.github.com/users/sithhell/following{/other_user}","gists_url":"https://api.github.com/users/sithhell/gists{/gist_id}","starred_url":"https://api.github.com/users/sithhell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sithhell/subscriptions","organizations_url":"https://api.github.com/users/sithhell/orgs","repos_url":"https://api.github.com/users/sithhell/repos","events_url":"https://api.github.com/users/sithhell/events{/privacy}","received_events_url":"https://api.github.com/users/sithhell/received_events","type":"User","site_admin":false},"body":"Calling package_action::get_future after package_action::apply might lead to\r\na rare race condition in the  lifetime management of the lcos::promise shared\r\nstate\r\n\r\nThis attempts to fix #2171 ","created_at":"2016-06-08T14:41:27Z","updated_at":"2016-06-10T14:14:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bf61ca208b16829a4120c9762695e3b9249372a","assignee":null,"milestone":{"url":"https://api.github.com/repos/STEllAR-GROUP/hpx/milestones/25","html_url":"https://github.com/STEllAR-GROUP/hpx/milestones/0.9.12","labels_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/milestones/25/labels","id":1380490,"number":25,"title":"0.9.12","description":"","creator":{"login":"hkaiser","id":568063,"avatar_url":"https://avatars.githubusercontent.com/u/568063?v=3","gravatar_id":"","url":"https://api.github.com/users/hkaiser","html_url":"https://github.com/hkaiser","followers_url":"https://api.github.com/users/hkaiser/followers","following_url":"https://api.github.com/users/hkaiser/following{/other_user}","gists_url":"https://api.github.com/users/hkaiser/gists{/gist_id}","starred_url":"https://api.github.com/users/hkaiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkaiser/subscriptions","organizations_url":"https://api.github.com/users/hkaiser/orgs","repos_url":"https://api.github.com/users/hkaiser/repos","events_url":"https://api.github.com/users/hkaiser/events{/privacy}","received_events_url":"https://api.github.com/users/hkaiser/received_events","type":"User","site_admin":false},"open_issues":53,"closed_issues":338,"state":"open","created_at":"2015-10-27T22:19:24Z","updated_at":"2016-06-10T14:03:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206/commits","review_comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206/comments","review_comment_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/2206/comments","statuses_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/statuses/5dcf1dfa1cafc0ede7c42ab3824d538658812828","head":{"label":"STEllAR-GROUP:fixing_2171","ref":"fixing_2171","sha":"5dcf1dfa1cafc0ede7c42ab3824d538658812828","user":{"login":"STEllAR-GROUP","id":1780988,"avatar_url":"https://avatars.githubusercontent.com/u/1780988?v=3","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"repo":{"id":4455628,"name":"hpx","full_name":"STEllAR-GROUP/hpx","owner":{"login":"STEllAR-GROUP","id":1780988,"avatar_url":"https://avatars.githubusercontent.com/u/1780988?v=3","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/STEllAR-GROUP/hpx","description":"A general purpose C++ runtime system for parallel and distributed applications of any scale","fork":false,"url":"https://api.github.com/repos/STEllAR-GROUP/hpx","forks_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/forks","keys_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/teams","hooks_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/hooks","issue_events_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/events{/number}","events_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/events","assignees_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/assignees{/user}","branches_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/branches{/branch}","tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/tags","blobs_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/refs{/sha}","trees_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/statuses/{sha}","languages_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/languages","stargazers_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/stargazers","contributors_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/contributors","subscribers_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/subscribers","subscription_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/subscription","commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/commits{/sha}","git_commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/commits{/sha}","comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/comments{/number}","issue_comment_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/comments{/number}","contents_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/contents/{+path}","compare_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/merges","archive_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/downloads","issues_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues{/number}","pulls_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls{/number}","milestones_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/milestones{/number}","notifications_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/labels{/name}","releases_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/releases{/id}","deployments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/deployments","created_at":"2012-05-26T15:02:39Z","updated_at":"2016-06-09T22:45:27Z","pushed_at":"2016-06-10T14:07:09Z","git_url":"git://github.com/STEllAR-GROUP/hpx.git","ssh_url":"git@github.com:STEllAR-GROUP/hpx.git","clone_url":"https://github.com/STEllAR-GROUP/hpx.git","svn_url":"https://github.com/STEllAR-GROUP/hpx","homepage":"http://stellar-group.org/libraries/hpx","size":509036,"stargazers_count":459,"watchers_count":459,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":107,"forks":125,"open_issues":107,"watchers":459,"default_branch":"master"}},"base":{"label":"STEllAR-GROUP:master","ref":"master","sha":"70595b227f0aae1ed303bf720163b0fdb26159fe","user":{"login":"STEllAR-GROUP","id":1780988,"avatar_url":"https://avatars.githubusercontent.com/u/1780988?v=3","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"repo":{"id":4455628,"name":"hpx","full_name":"STEllAR-GROUP/hpx","owner":{"login":"STEllAR-GROUP","id":1780988,"avatar_url":"https://avatars.githubusercontent.com/u/1780988?v=3","gravatar_id":"","url":"https://api.github.com/users/STEllAR-GROUP","html_url":"https://github.com/STEllAR-GROUP","followers_url":"https://api.github.com/users/STEllAR-GROUP/followers","following_url":"https://api.github.com/users/STEllAR-GROUP/following{/other_user}","gists_url":"https://api.github.com/users/STEllAR-GROUP/gists{/gist_id}","starred_url":"https://api.github.com/users/STEllAR-GROUP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STEllAR-GROUP/subscriptions","organizations_url":"https://api.github.com/users/STEllAR-GROUP/orgs","repos_url":"https://api.github.com/users/STEllAR-GROUP/repos","events_url":"https://api.github.com/users/STEllAR-GROUP/events{/privacy}","received_events_url":"https://api.github.com/users/STEllAR-GROUP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/STEllAR-GROUP/hpx","description":"A general purpose C++ runtime system for parallel and distributed applications of any scale","fork":false,"url":"https://api.github.com/repos/STEllAR-GROUP/hpx","forks_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/forks","keys_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/teams","hooks_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/hooks","issue_events_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/events{/number}","events_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/events","assignees_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/assignees{/user}","branches_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/branches{/branch}","tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/tags","blobs_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/refs{/sha}","trees_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/statuses/{sha}","languages_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/languages","stargazers_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/stargazers","contributors_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/contributors","subscribers_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/subscribers","subscription_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/subscription","commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/commits{/sha}","git_commits_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/git/commits{/sha}","comments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/comments{/number}","issue_comment_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/comments{/number}","contents_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/contents/{+path}","compare_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/merges","archive_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/downloads","issues_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues{/number}","pulls_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls{/number}","milestones_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/milestones{/number}","notifications_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/labels{/name}","releases_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/releases{/id}","deployments_url":"https://api.github.com/repos/STEllAR-GROUP/hpx/deployments","created_at":"2012-05-26T15:02:39Z","updated_at":"2016-06-09T22:45:27Z","pushed_at":"2016-06-10T14:07:09Z","git_url":"git://github.com/STEllAR-GROUP/hpx.git","ssh_url":"git@github.com:STEllAR-GROUP/hpx.git","clone_url":"https://github.com/STEllAR-GROUP/hpx.git","svn_url":"https://github.com/STEllAR-GROUP/hpx","homepage":"http://stellar-group.org/libraries/hpx","size":509036,"stargazers_count":459,"watchers_count":459,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":107,"forks":125,"open_issues":107,"watchers":459,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206"},"html":{"href":"https://github.com/STEllAR-GROUP/hpx/pull/2206"},"issue":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/2206"},"comments":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/issues/2206/comments"},"review_comments":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206/comments"},"review_comment":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/pulls/2206/commits"},"statuses":{"href":"https://api.github.com/repos/STEllAR-GROUP/hpx/statuses/5dcf1dfa1cafc0ede7c42ab3824d538658812828"}}}}
{"actor":{"display_login":"hkaiser"}}