{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rmw/pulls/comments/110347983","pull_request_review_id":31515035,"id":110347983,"diff_hunk":"@@ -17,8 +17,21 @@\n \n #if defined _WIN32 || defined __CYGWIN__\n   #define RMW_THREAD_LOCAL __declspec(thread)\n+#elif defined __APPLE__\n+  #include <Availability.h>\n+  #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)\n+    // iOS 10 added support for thread local storage\n+    #if __IPHONE_OS_VERSION_MAX_ALLOWED < 100000\n+      #define RMW_THREAD_LOCAL_PTHREAD 1\n+      #define RMW_THREAD_LOCAL\n+    #endif\n+  #endif\n+\n+  #ifndef RMW_THREAD_LOCAL_PTHREAD\n+    #define RMW_THREAD_LOCAL _Thread_local\n+  #endif\n #else\n-  #define RMW_THREAD_LOCAL __thread\n+  #define RMW_THREAD_LOCAL _Thread_local","path":"rmw/include/rmw/macros.h","position":19,"original_position":19,"commit_id":"cec0385ab052d82d002930405ba7ba666716ac4e","original_commit_id":"5e0d643b1c00f5ce13dc1d58246503e50b8b5752","user":{"login":"esteve","id":33620,"avatar_url":"https://avatars2.githubusercontent.com/u/33620?v=3","gravatar_id":"","url":"https://api.github.com/users/esteve","html_url":"https://github.com/esteve","followers_url":"https://api.github.com/users/esteve/followers","following_url":"https://api.github.com/users/esteve/following{/other_user}","gists_url":"https://api.github.com/users/esteve/gists{/gist_id}","starred_url":"https://api.github.com/users/esteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esteve/subscriptions","organizations_url":"https://api.github.com/users/esteve/orgs","repos_url":"https://api.github.com/users/esteve/repos","events_url":"https://api.github.com/users/esteve/events{/privacy}","received_events_url":"https://api.github.com/users/esteve/received_events","type":"User","site_admin":false},"body":"C11 added support for TLS via `_Thread_local`, `__thread` is a GCC extension that Clang supports for compatibility reasons. I can revert it to `__thread`, but I thought that given that IIRC ROS2 now requires a C11-capable compiler, it might be nice to use `_Thread_local` instead.","created_at":"2017-04-07T09:12:30Z","updated_at":"2017-04-07T09:12:30Z","html_url":"https://github.com/ros2/rmw/pull/80#discussion_r110347983","pull_request_url":"https://api.github.com/repos/ros2/rmw/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/ros2/rmw/pulls/comments/110347983"},"html":{"href":"https://github.com/ros2/rmw/pull/80#discussion_r110347983"},"pull_request":{"href":"https://api.github.com/repos/ros2/rmw/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/rmw/pulls/80","id":97090329,"html_url":"https://github.com/ros2/rmw/pull/80","diff_url":"https://github.com/ros2/rmw/pull/80.diff","patch_url":"https://github.com/ros2/rmw/pull/80.patch","issue_url":"https://api.github.com/repos/ros2/rmw/issues/80","number":80,"state":"open","locked":false,"title":"Add support for pthread-based thread local storage","user":{"login":"esteve","id":33620,"avatar_url":"https://avatars2.githubusercontent.com/u/33620?v=3","gravatar_id":"","url":"https://api.github.com/users/esteve","html_url":"https://github.com/esteve","followers_url":"https://api.github.com/users/esteve/followers","following_url":"https://api.github.com/users/esteve/following{/other_user}","gists_url":"https://api.github.com/users/esteve/gists{/gist_id}","starred_url":"https://api.github.com/users/esteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esteve/subscriptions","organizations_url":"https://api.github.com/users/esteve/orgs","repos_url":"https://api.github.com/users/esteve/repos","events_url":"https://api.github.com/users/esteve/events{/privacy}","received_events_url":"https://api.github.com/users/esteve/received_events","type":"User","site_admin":false},"body":"This PR adds support for pthread-based thread local storage on platforms that don't have compiler builtin support for it. I only enabled it for iOS < 10.0, but it can be extended to any other platform via CMake flags.","created_at":"2016-12-08T09:55:55Z","updated_at":"2017-04-07T09:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bae65139b619a95733bd3a028fcbd285230091f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rmw/pulls/80/commits","review_comments_url":"https://api.github.com/repos/ros2/rmw/pulls/80/comments","review_comment_url":"https://api.github.com/repos/ros2/rmw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rmw/issues/80/comments","statuses_url":"https://api.github.com/repos/ros2/rmw/statuses/cec0385ab052d82d002930405ba7ba666716ac4e","head":{"label":"esteve:thread-local-ios","ref":"thread-local-ios","sha":"cec0385ab052d82d002930405ba7ba666716ac4e","user":{"login":"esteve","id":33620,"avatar_url":"https://avatars2.githubusercontent.com/u/33620?v=3","gravatar_id":"","url":"https://api.github.com/users/esteve","html_url":"https://github.com/esteve","followers_url":"https://api.github.com/users/esteve/followers","following_url":"https://api.github.com/users/esteve/following{/other_user}","gists_url":"https://api.github.com/users/esteve/gists{/gist_id}","starred_url":"https://api.github.com/users/esteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esteve/subscriptions","organizations_url":"https://api.github.com/users/esteve/orgs","repos_url":"https://api.github.com/users/esteve/repos","events_url":"https://api.github.com/users/esteve/events{/privacy}","received_events_url":"https://api.github.com/users/esteve/received_events","type":"User","site_admin":false},"repo":{"id":60628083,"name":"rmw","full_name":"esteve/rmw","owner":{"login":"esteve","id":33620,"avatar_url":"https://avatars2.githubusercontent.com/u/33620?v=3","gravatar_id":"","url":"https://api.github.com/users/esteve","html_url":"https://github.com/esteve","followers_url":"https://api.github.com/users/esteve/followers","following_url":"https://api.github.com/users/esteve/following{/other_user}","gists_url":"https://api.github.com/users/esteve/gists{/gist_id}","starred_url":"https://api.github.com/users/esteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esteve/subscriptions","organizations_url":"https://api.github.com/users/esteve/orgs","repos_url":"https://api.github.com/users/esteve/repos","events_url":"https://api.github.com/users/esteve/events{/privacy}","received_events_url":"https://api.github.com/users/esteve/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/esteve/rmw","description":"The ROS Middleware (rmw) Interface.","fork":true,"url":"https://api.github.com/repos/esteve/rmw","forks_url":"https://api.github.com/repos/esteve/rmw/forks","keys_url":"https://api.github.com/repos/esteve/rmw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esteve/rmw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esteve/rmw/teams","hooks_url":"https://api.github.com/repos/esteve/rmw/hooks","issue_events_url":"https://api.github.com/repos/esteve/rmw/issues/events{/number}","events_url":"https://api.github.com/repos/esteve/rmw/events","assignees_url":"https://api.github.com/repos/esteve/rmw/assignees{/user}","branches_url":"https://api.github.com/repos/esteve/rmw/branches{/branch}","tags_url":"https://api.github.com/repos/esteve/rmw/tags","blobs_url":"https://api.github.com/repos/esteve/rmw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esteve/rmw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esteve/rmw/git/refs{/sha}","trees_url":"https://api.github.com/repos/esteve/rmw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esteve/rmw/statuses/{sha}","languages_url":"https://api.github.com/repos/esteve/rmw/languages","stargazers_url":"https://api.github.com/repos/esteve/rmw/stargazers","contributors_url":"https://api.github.com/repos/esteve/rmw/contributors","subscribers_url":"https://api.github.com/repos/esteve/rmw/subscribers","subscription_url":"https://api.github.com/repos/esteve/rmw/subscription","commits_url":"https://api.github.com/repos/esteve/rmw/commits{/sha}","git_commits_url":"https://api.github.com/repos/esteve/rmw/git/commits{/sha}","comments_url":"https://api.github.com/repos/esteve/rmw/comments{/number}","issue_comment_url":"https://api.github.com/repos/esteve/rmw/issues/comments{/number}","contents_url":"https://api.github.com/repos/esteve/rmw/contents/{+path}","compare_url":"https://api.github.com/repos/esteve/rmw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esteve/rmw/merges","archive_url":"https://api.github.com/repos/esteve/rmw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esteve/rmw/downloads","issues_url":"https://api.github.com/repos/esteve/rmw/issues{/number}","pulls_url":"https://api.github.com/repos/esteve/rmw/pulls{/number}","milestones_url":"https://api.github.com/repos/esteve/rmw/milestones{/number}","notifications_url":"https://api.github.com/repos/esteve/rmw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esteve/rmw/labels{/name}","releases_url":"https://api.github.com/repos/esteve/rmw/releases{/id}","deployments_url":"https://api.github.com/repos/esteve/rmw/deployments","created_at":"2016-06-07T16:14:17Z","updated_at":"2016-06-07T16:14:18Z","pushed_at":"2017-04-07T02:04:38Z","git_url":"git://github.com/esteve/rmw.git","ssh_url":"git@github.com:esteve/rmw.git","clone_url":"https://github.com/esteve/rmw.git","svn_url":"https://github.com/esteve/rmw","homepage":"","size":199,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"ros2:master","ref":"master","sha":"d5b8aff18ee649ea2874d45d1dc6f4c39ecf7b7b","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":22737319,"name":"rmw","full_name":"ros2/rmw","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rmw","description":"The ROS Middleware (rmw) Interface.","fork":false,"url":"https://api.github.com/repos/ros2/rmw","forks_url":"https://api.github.com/repos/ros2/rmw/forks","keys_url":"https://api.github.com/repos/ros2/rmw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rmw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rmw/teams","hooks_url":"https://api.github.com/repos/ros2/rmw/hooks","issue_events_url":"https://api.github.com/repos/ros2/rmw/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rmw/events","assignees_url":"https://api.github.com/repos/ros2/rmw/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rmw/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rmw/tags","blobs_url":"https://api.github.com/repos/ros2/rmw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rmw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rmw/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rmw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rmw/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rmw/languages","stargazers_url":"https://api.github.com/repos/ros2/rmw/stargazers","contributors_url":"https://api.github.com/repos/ros2/rmw/contributors","subscribers_url":"https://api.github.com/repos/ros2/rmw/subscribers","subscription_url":"https://api.github.com/repos/ros2/rmw/subscription","commits_url":"https://api.github.com/repos/ros2/rmw/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rmw/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rmw/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rmw/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rmw/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rmw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rmw/merges","archive_url":"https://api.github.com/repos/ros2/rmw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rmw/downloads","issues_url":"https://api.github.com/repos/ros2/rmw/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rmw/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rmw/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rmw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rmw/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rmw/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/rmw/deployments","created_at":"2014-08-07T21:35:58Z","updated_at":"2016-10-25T21:31:42Z","pushed_at":"2017-04-07T02:04:39Z","git_url":"git://github.com/ros2/rmw.git","ssh_url":"git@github.com:ros2/rmw.git","clone_url":"https://github.com/ros2/rmw.git","svn_url":"https://github.com/ros2/rmw","homepage":"","size":227,"stargazers_count":5,"watchers_count":5,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":11,"forks":7,"open_issues":11,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rmw/pulls/80"},"html":{"href":"https://github.com/ros2/rmw/pull/80"},"issue":{"href":"https://api.github.com/repos/ros2/rmw/issues/80"},"comments":{"href":"https://api.github.com/repos/ros2/rmw/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rmw/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rmw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rmw/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rmw/statuses/cec0385ab052d82d002930405ba7ba666716ac4e"}}}}
{"actor":{"display_login":"esteve"}}