{"action":"created","comment":{"url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments/68906834","id":68906834,"diff_hunk":"@@ -286,16 +287,13 @@ namespace dsn {\n         uint64_t                           _message_sent;\n         // ]\n \n-        ::dsn::utils::ex_lock_nr           _delay_lock; // [\n-        int                                _delay_server_receive_ms;\n-        // ]\n+        std::atomic_int                    _delay_server_receive_ms;\n     };\n \n     // --------- inline implementation --------------\n     inline void rpc_session::delay_recv(int delay_ms)\n     {\n-        utils::auto_lock<utils::ex_lock_nr> l(_delay_lock);\n-        if (delay_ms > _delay_server_receive_ms)\n-            _delay_server_receive_ms = delay_ms;\n+        int old_delay_ms = _delay_server_receive_ms.load();\n+        while (delay_ms > old_delay_ms && !_delay_server_receive_ms.compare_exchange_weak(old_delay_ms, delay_ms)) {}","path":"include/dsn/internal/network.h","position":25,"original_position":25,"commit_id":"9689ad2d11868e1492afdb690e07a26719adf504","original_commit_id":"9689ad2d11868e1492afdb690e07a26719adf504","user":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"body":"if _delay_server_receive_ms is set to be other value by concurrent delay_recv, can this exit?","created_at":"2016-06-29T08:44:35Z","updated_at":"2016-06-29T08:44:35Z","html_url":"https://github.com/imzhenyu/rDSN/pull/424#discussion_r68906834","pull_request_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424","_links":{"self":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments/68906834"},"html":{"href":"https://github.com/imzhenyu/rDSN/pull/424#discussion_r68906834"},"pull_request":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424"}}},"pull_request":{"url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424","id":75606313,"html_url":"https://github.com/imzhenyu/rDSN/pull/424","diff_url":"https://github.com/imzhenyu/rDSN/pull/424.diff","patch_url":"https://github.com/imzhenyu/rDSN/pull/424.patch","issue_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/424","number":424,"state":"open","locked":false,"title":"use lock free atomic to replace lock","user":{"login":"qinzuoyan","id":528445,"avatar_url":"https://avatars.githubusercontent.com/u/528445?v=3","gravatar_id":"","url":"https://api.github.com/users/qinzuoyan","html_url":"https://github.com/qinzuoyan","followers_url":"https://api.github.com/users/qinzuoyan/followers","following_url":"https://api.github.com/users/qinzuoyan/following{/other_user}","gists_url":"https://api.github.com/users/qinzuoyan/gists{/gist_id}","starred_url":"https://api.github.com/users/qinzuoyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qinzuoyan/subscriptions","organizations_url":"https://api.github.com/users/qinzuoyan/orgs","repos_url":"https://api.github.com/users/qinzuoyan/repos","events_url":"https://api.github.com/users/qinzuoyan/events{/privacy}","received_events_url":"https://api.github.com/users/qinzuoyan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-29T08:21:04Z","updated_at":"2016-06-29T08:44:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a530d63d80828fab4e23669fbd3a95b1fba2de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424/commits","review_comments_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424/comments","review_comment_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments{/number}","comments_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/424/comments","statuses_url":"https://api.github.com/repos/imzhenyu/rDSN/statuses/9689ad2d11868e1492afdb690e07a26719adf504","head":{"label":"imzhenyu:qinzuoyan","ref":"qinzuoyan","sha":"9689ad2d11868e1492afdb690e07a26719adf504","user":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"repo":{"id":37038578,"name":"rDSN","full_name":"imzhenyu/rDSN","owner":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imzhenyu/rDSN","description":"Robust Distributed System Nucleus (rDSN) is an open framework for quickly building and managing high performance and robust distributed systems.","fork":true,"url":"https://api.github.com/repos/imzhenyu/rDSN","forks_url":"https://api.github.com/repos/imzhenyu/rDSN/forks","keys_url":"https://api.github.com/repos/imzhenyu/rDSN/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imzhenyu/rDSN/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imzhenyu/rDSN/teams","hooks_url":"https://api.github.com/repos/imzhenyu/rDSN/hooks","issue_events_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/events{/number}","events_url":"https://api.github.com/repos/imzhenyu/rDSN/events","assignees_url":"https://api.github.com/repos/imzhenyu/rDSN/assignees{/user}","branches_url":"https://api.github.com/repos/imzhenyu/rDSN/branches{/branch}","tags_url":"https://api.github.com/repos/imzhenyu/rDSN/tags","blobs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imzhenyu/rDSN/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/refs{/sha}","trees_url":"https://api.github.com/repos/imzhenyu/rDSN/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imzhenyu/rDSN/statuses/{sha}","languages_url":"https://api.github.com/repos/imzhenyu/rDSN/languages","stargazers_url":"https://api.github.com/repos/imzhenyu/rDSN/stargazers","contributors_url":"https://api.github.com/repos/imzhenyu/rDSN/contributors","subscribers_url":"https://api.github.com/repos/imzhenyu/rDSN/subscribers","subscription_url":"https://api.github.com/repos/imzhenyu/rDSN/subscription","commits_url":"https://api.github.com/repos/imzhenyu/rDSN/commits{/sha}","git_commits_url":"https://api.github.com/repos/imzhenyu/rDSN/git/commits{/sha}","comments_url":"https://api.github.com/repos/imzhenyu/rDSN/comments{/number}","issue_comment_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/comments{/number}","contents_url":"https://api.github.com/repos/imzhenyu/rDSN/contents/{+path}","compare_url":"https://api.github.com/repos/imzhenyu/rDSN/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imzhenyu/rDSN/merges","archive_url":"https://api.github.com/repos/imzhenyu/rDSN/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imzhenyu/rDSN/downloads","issues_url":"https://api.github.com/repos/imzhenyu/rDSN/issues{/number}","pulls_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls{/number}","milestones_url":"https://api.github.com/repos/imzhenyu/rDSN/milestones{/number}","notifications_url":"https://api.github.com/repos/imzhenyu/rDSN/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imzhenyu/rDSN/labels{/name}","releases_url":"https://api.github.com/repos/imzhenyu/rDSN/releases{/id}","deployments_url":"https://api.github.com/repos/imzhenyu/rDSN/deployments","created_at":"2015-06-08T00:54:11Z","updated_at":"2016-05-31T09:59:35Z","pushed_at":"2016-06-29T08:21:04Z","git_url":"git://github.com/imzhenyu/rDSN.git","ssh_url":"git@github.com:imzhenyu/rDSN.git","clone_url":"https://github.com/imzhenyu/rDSN.git","svn_url":"https://github.com/imzhenyu/rDSN","homepage":null,"size":78262,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":27,"forks":10,"open_issues":27,"watchers":14,"default_branch":"master"}},"base":{"label":"imzhenyu:master","ref":"master","sha":"3b3de7564a926d76c26bfbe397e7a4a56891572f","user":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"repo":{"id":37038578,"name":"rDSN","full_name":"imzhenyu/rDSN","owner":{"login":"imzhenyu","id":6927143,"avatar_url":"https://avatars.githubusercontent.com/u/6927143?v=3","gravatar_id":"","url":"https://api.github.com/users/imzhenyu","html_url":"https://github.com/imzhenyu","followers_url":"https://api.github.com/users/imzhenyu/followers","following_url":"https://api.github.com/users/imzhenyu/following{/other_user}","gists_url":"https://api.github.com/users/imzhenyu/gists{/gist_id}","starred_url":"https://api.github.com/users/imzhenyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imzhenyu/subscriptions","organizations_url":"https://api.github.com/users/imzhenyu/orgs","repos_url":"https://api.github.com/users/imzhenyu/repos","events_url":"https://api.github.com/users/imzhenyu/events{/privacy}","received_events_url":"https://api.github.com/users/imzhenyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imzhenyu/rDSN","description":"Robust Distributed System Nucleus (rDSN) is an open framework for quickly building and managing high performance and robust distributed systems.","fork":true,"url":"https://api.github.com/repos/imzhenyu/rDSN","forks_url":"https://api.github.com/repos/imzhenyu/rDSN/forks","keys_url":"https://api.github.com/repos/imzhenyu/rDSN/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imzhenyu/rDSN/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imzhenyu/rDSN/teams","hooks_url":"https://api.github.com/repos/imzhenyu/rDSN/hooks","issue_events_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/events{/number}","events_url":"https://api.github.com/repos/imzhenyu/rDSN/events","assignees_url":"https://api.github.com/repos/imzhenyu/rDSN/assignees{/user}","branches_url":"https://api.github.com/repos/imzhenyu/rDSN/branches{/branch}","tags_url":"https://api.github.com/repos/imzhenyu/rDSN/tags","blobs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imzhenyu/rDSN/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imzhenyu/rDSN/git/refs{/sha}","trees_url":"https://api.github.com/repos/imzhenyu/rDSN/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imzhenyu/rDSN/statuses/{sha}","languages_url":"https://api.github.com/repos/imzhenyu/rDSN/languages","stargazers_url":"https://api.github.com/repos/imzhenyu/rDSN/stargazers","contributors_url":"https://api.github.com/repos/imzhenyu/rDSN/contributors","subscribers_url":"https://api.github.com/repos/imzhenyu/rDSN/subscribers","subscription_url":"https://api.github.com/repos/imzhenyu/rDSN/subscription","commits_url":"https://api.github.com/repos/imzhenyu/rDSN/commits{/sha}","git_commits_url":"https://api.github.com/repos/imzhenyu/rDSN/git/commits{/sha}","comments_url":"https://api.github.com/repos/imzhenyu/rDSN/comments{/number}","issue_comment_url":"https://api.github.com/repos/imzhenyu/rDSN/issues/comments{/number}","contents_url":"https://api.github.com/repos/imzhenyu/rDSN/contents/{+path}","compare_url":"https://api.github.com/repos/imzhenyu/rDSN/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imzhenyu/rDSN/merges","archive_url":"https://api.github.com/repos/imzhenyu/rDSN/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imzhenyu/rDSN/downloads","issues_url":"https://api.github.com/repos/imzhenyu/rDSN/issues{/number}","pulls_url":"https://api.github.com/repos/imzhenyu/rDSN/pulls{/number}","milestones_url":"https://api.github.com/repos/imzhenyu/rDSN/milestones{/number}","notifications_url":"https://api.github.com/repos/imzhenyu/rDSN/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imzhenyu/rDSN/labels{/name}","releases_url":"https://api.github.com/repos/imzhenyu/rDSN/releases{/id}","deployments_url":"https://api.github.com/repos/imzhenyu/rDSN/deployments","created_at":"2015-06-08T00:54:11Z","updated_at":"2016-05-31T09:59:35Z","pushed_at":"2016-06-29T08:21:04Z","git_url":"git://github.com/imzhenyu/rDSN.git","ssh_url":"git@github.com:imzhenyu/rDSN.git","clone_url":"https://github.com/imzhenyu/rDSN.git","svn_url":"https://github.com/imzhenyu/rDSN","homepage":null,"size":78262,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":27,"forks":10,"open_issues":27,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424"},"html":{"href":"https://github.com/imzhenyu/rDSN/pull/424"},"issue":{"href":"https://api.github.com/repos/imzhenyu/rDSN/issues/424"},"comments":{"href":"https://api.github.com/repos/imzhenyu/rDSN/issues/424/comments"},"review_comments":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424/comments"},"review_comment":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/imzhenyu/rDSN/pulls/424/commits"},"statuses":{"href":"https://api.github.com/repos/imzhenyu/rDSN/statuses/9689ad2d11868e1492afdb690e07a26719adf504"}}}}
{"actor":{"display_login":"imzhenyu"}}