{"action":"created","comment":{"url":"https://api.github.com/repos/reverbrain/swarm/pulls/comments/25693385","id":25693385,"diff_hunk":"@@ -50,9 +50,62 @@\n namespace ioremap {\n namespace thevoid {\n \n-class server_data;\n+namespace signal_handler {\n \n-static std::weak_ptr<signal_handler> global_signal_set;\n+std::mutex lock;\n+std::set<base_server*> all_servers;\n+\n+static\n+void stop(int signal_value)\n+{\n+\tstd::lock_guard<std::mutex> locker(lock);","path":"thevoid/server.cpp","position":14,"original_position":14,"commit_id":"1957a1e4992a354f67b0038d893caa5eb4e05039","original_commit_id":"1957a1e4992a354f67b0038d893caa5eb4e05039","user":{"login":"shindo","id":863752,"avatar_url":"https://avatars.githubusercontent.com/u/863752?v=3","gravatar_id":"","url":"https://api.github.com/users/shindo","html_url":"https://github.com/shindo","followers_url":"https://api.github.com/users/shindo/followers","following_url":"https://api.github.com/users/shindo/following{/other_user}","gists_url":"https://api.github.com/users/shindo/gists{/gist_id}","starred_url":"https://api.github.com/users/shindo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shindo/subscriptions","organizations_url":"https://api.github.com/users/shindo/orgs","repos_url":"https://api.github.com/users/shindo/repos","events_url":"https://api.github.com/users/shindo/events{/privacy}","received_events_url":"https://api.github.com/users/shindo/received_events","type":"User","site_admin":false},"body":"Really? Have you seen the current implementation?","created_at":"2015-03-03T15:02:34Z","updated_at":"2015-03-03T15:02:34Z","html_url":"https://github.com/reverbrain/swarm/pull/31#discussion_r25693385","pull_request_url":"https://api.github.com/repos/reverbrain/swarm/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/comments/25693385"},"html":{"href":"https://github.com/reverbrain/swarm/pull/31#discussion_r25693385"},"pull_request":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/reverbrain/swarm/pulls/31","id":30249326,"html_url":"https://github.com/reverbrain/swarm/pull/31","diff_url":"https://github.com/reverbrain/swarm/pull/31.diff","patch_url":"https://github.com/reverbrain/swarm/pull/31.patch","issue_url":"https://api.github.com/repos/reverbrain/swarm/issues/31","number":31,"state":"closed","locked":false,"title":"Signal handling reworked.","user":{"login":"shindo","id":863752,"avatar_url":"https://avatars.githubusercontent.com/u/863752?v=3","gravatar_id":"","url":"https://api.github.com/users/shindo","html_url":"https://github.com/shindo","followers_url":"https://api.github.com/users/shindo/followers","following_url":"https://api.github.com/users/shindo/following{/other_user}","gists_url":"https://api.github.com/users/shindo/gists{/gist_id}","starred_url":"https://api.github.com/users/shindo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shindo/subscriptions","organizations_url":"https://api.github.com/users/shindo/orgs","repos_url":"https://api.github.com/users/shindo/repos","events_url":"https://api.github.com/users/shindo/events{/privacy}","received_events_url":"https://api.github.com/users/shindo/received_events","type":"User","site_admin":false},"body":"Merge #30 first.\r\n\r\nAll signal handling mechanics moved to thevoid::signal_handler namespace.\r\n\r\nAdded functions to add/remove server to/from global signal handling:\r\n    thevoid::signal_handler::add_server(base_server\\*)\r\n    thevoid::signal_handler::remove_server(base_server\\*)\r\n\r\nAdded functions to register stop/reload signals:\r\n    thevoid::signal_handler::register_stop(int signal)\r\n    thevoid::signal_handler::register_reload(int signal)","created_at":"2015-03-01T21:37:30Z","updated_at":"2015-03-03T15:02:35Z","closed_at":"2015-03-03T14:42:56Z","merged_at":null,"merge_commit_sha":"b6ab7178d5b20eb51381ac253c82c9fd6734fd9c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/reverbrain/swarm/pulls/31/commits","review_comments_url":"https://api.github.com/repos/reverbrain/swarm/pulls/31/comments","review_comment_url":"https://api.github.com/repos/reverbrain/swarm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reverbrain/swarm/issues/31/comments","statuses_url":"https://api.github.com/repos/reverbrain/swarm/statuses/1957a1e4992a354f67b0038d893caa5eb4e05039","head":{"label":"shindo:pull-signal-handler","ref":"pull-signal-handler","sha":"1957a1e4992a354f67b0038d893caa5eb4e05039","user":{"login":"shindo","id":863752,"avatar_url":"https://avatars.githubusercontent.com/u/863752?v=3","gravatar_id":"","url":"https://api.github.com/users/shindo","html_url":"https://github.com/shindo","followers_url":"https://api.github.com/users/shindo/followers","following_url":"https://api.github.com/users/shindo/following{/other_user}","gists_url":"https://api.github.com/users/shindo/gists{/gist_id}","starred_url":"https://api.github.com/users/shindo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shindo/subscriptions","organizations_url":"https://api.github.com/users/shindo/orgs","repos_url":"https://api.github.com/users/shindo/repos","events_url":"https://api.github.com/users/shindo/events{/privacy}","received_events_url":"https://api.github.com/users/shindo/received_events","type":"User","site_admin":false},"repo":{"id":23220802,"name":"swarm","full_name":"shindo/swarm","owner":{"login":"shindo","id":863752,"avatar_url":"https://avatars.githubusercontent.com/u/863752?v=3","gravatar_id":"","url":"https://api.github.com/users/shindo","html_url":"https://github.com/shindo","followers_url":"https://api.github.com/users/shindo/followers","following_url":"https://api.github.com/users/shindo/following{/other_user}","gists_url":"https://api.github.com/users/shindo/gists{/gist_id}","starred_url":"https://api.github.com/users/shindo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shindo/subscriptions","organizations_url":"https://api.github.com/users/shindo/orgs","repos_url":"https://api.github.com/users/shindo/repos","events_url":"https://api.github.com/users/shindo/events{/privacy}","received_events_url":"https://api.github.com/users/shindo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shindo/swarm","description":"Swarm is aiming at your web","fork":true,"url":"https://api.github.com/repos/shindo/swarm","forks_url":"https://api.github.com/repos/shindo/swarm/forks","keys_url":"https://api.github.com/repos/shindo/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shindo/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shindo/swarm/teams","hooks_url":"https://api.github.com/repos/shindo/swarm/hooks","issue_events_url":"https://api.github.com/repos/shindo/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/shindo/swarm/events","assignees_url":"https://api.github.com/repos/shindo/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/shindo/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/shindo/swarm/tags","blobs_url":"https://api.github.com/repos/shindo/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shindo/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shindo/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/shindo/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shindo/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/shindo/swarm/languages","stargazers_url":"https://api.github.com/repos/shindo/swarm/stargazers","contributors_url":"https://api.github.com/repos/shindo/swarm/contributors","subscribers_url":"https://api.github.com/repos/shindo/swarm/subscribers","subscription_url":"https://api.github.com/repos/shindo/swarm/subscription","commits_url":"https://api.github.com/repos/shindo/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/shindo/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/shindo/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/shindo/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/shindo/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/shindo/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shindo/swarm/merges","archive_url":"https://api.github.com/repos/shindo/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shindo/swarm/downloads","issues_url":"https://api.github.com/repos/shindo/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/shindo/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/shindo/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/shindo/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shindo/swarm/labels{/name}","releases_url":"https://api.github.com/repos/shindo/swarm/releases{/id}","created_at":"2014-08-22T09:52:08Z","updated_at":"2015-02-08T21:13:29Z","pushed_at":"2015-03-02T14:54:51Z","git_url":"git://github.com/shindo/swarm.git","ssh_url":"git@github.com:shindo/swarm.git","clone_url":"https://github.com/shindo/swarm.git","svn_url":"https://github.com/shindo/swarm","homepage":null,"size":2103,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"reverbrain:master","ref":"master","sha":"cfd184377bde0969a471e7ed77bf11fbb3de9e3c","user":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"repo":{"id":8936566,"name":"swarm","full_name":"reverbrain/swarm","owner":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reverbrain/swarm","description":"Swarm is aiming at your web","fork":false,"url":"https://api.github.com/repos/reverbrain/swarm","forks_url":"https://api.github.com/repos/reverbrain/swarm/forks","keys_url":"https://api.github.com/repos/reverbrain/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reverbrain/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reverbrain/swarm/teams","hooks_url":"https://api.github.com/repos/reverbrain/swarm/hooks","issue_events_url":"https://api.github.com/repos/reverbrain/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/reverbrain/swarm/events","assignees_url":"https://api.github.com/repos/reverbrain/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/reverbrain/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/reverbrain/swarm/tags","blobs_url":"https://api.github.com/repos/reverbrain/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reverbrain/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reverbrain/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/reverbrain/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reverbrain/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/reverbrain/swarm/languages","stargazers_url":"https://api.github.com/repos/reverbrain/swarm/stargazers","contributors_url":"https://api.github.com/repos/reverbrain/swarm/contributors","subscribers_url":"https://api.github.com/repos/reverbrain/swarm/subscribers","subscription_url":"https://api.github.com/repos/reverbrain/swarm/subscription","commits_url":"https://api.github.com/repos/reverbrain/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/reverbrain/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/reverbrain/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/reverbrain/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/reverbrain/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/reverbrain/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reverbrain/swarm/merges","archive_url":"https://api.github.com/repos/reverbrain/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reverbrain/swarm/downloads","issues_url":"https://api.github.com/repos/reverbrain/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/reverbrain/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/reverbrain/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/reverbrain/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reverbrain/swarm/labels{/name}","releases_url":"https://api.github.com/repos/reverbrain/swarm/releases{/id}","created_at":"2013-03-21T19:13:26Z","updated_at":"2015-03-03T14:40:40Z","pushed_at":"2015-03-03T14:40:39Z","git_url":"git://github.com/reverbrain/swarm.git","ssh_url":"git@github.com:reverbrain/swarm.git","clone_url":"https://github.com/reverbrain/swarm.git","svn_url":"https://github.com/reverbrain/swarm","homepage":null,"size":2478,"stargazers_count":12,"watchers_count":12,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":7,"forks":11,"open_issues":7,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/31"},"html":{"href":"https://github.com/reverbrain/swarm/pull/31"},"issue":{"href":"https://api.github.com/repos/reverbrain/swarm/issues/31"},"comments":{"href":"https://api.github.com/repos/reverbrain/swarm/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reverbrain/swarm/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/reverbrain/swarm/statuses/1957a1e4992a354f67b0038d893caa5eb4e05039"}}}}