{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments/67439973","id":67439973,"diff_hunk":"@@ -92,10 +92,75 @@ _dispatch_thread_key_create(const unsigned long *k, void (*d)(void *))\n \tif (!*k || !d) return;\n \tdispatch_assert_zero(pthread_key_init_np((int)*k, d));\n }\n+#elif DISPATCH_USE_THREAD_LOCAL_STORAGE\n+\n+DISPATCH_TSD_INLINE\n+static inline void\n+_dispatch_thread_key_create(pthread_key_t *k, void (*d)(void *))\n+{\n+\tdispatch_assert_zero(pthread_key_create(k, d));\n+}\n+\n+struct dispatch_tsd {\n+\tbool initialized;\n+\tpid_t tid;\n+\tvoid *dispatch_queue_key;\n+\tvoid *dispatch_frame_key;\n+\tvoid *dispatch_cache_key;\n+\tvoid *dispatch_context_key;\n+\tvoid *dispatch_pthread_root_queue_observer_hooks_key;\n+\tvoid *dispatch_defaultpriority_key;\n+#if DISPATCH_INTROSPECTION\n+\tvoid *dispatch_introspection_key;\n+#elif DISPATCH_PERF_MON\n+\tvoid *dispatch_bcounter_key;\n+#endif\n+#if DISPATCH_LOCK_USE_SEMAPHORE_FALLBACK\n+\tvoid *dispatch_sema4_key;\n+#endif\n+\tvoid *dispatch_priority_key;\n+\tvoid *dispatch_voucher_key;\n+\tvoid *dispatch_deferred_items_key;\n+};\n+\n+extern __thread struct dispatch_tsd __dispatch_tsd;\n+extern pthread_key_t __dispatch_tsd_key;\n+extern void libdispatch_tsd_init(void);\n+\n+DISPATCH_ALWAYS_INLINE\n+static inline struct dispatch_tsd *\n+_dispatch_get_tsd_base(void)\n+{\n+\tif (slowpath(!__dispatch_tsd.initialized)) {\n+\t\tlibdispatch_tsd_init();\n+\t}\n+\treturn &__dispatch_tsd;\n+}\n+\n+#define _dispatch_thread_getspecific(key) \\\n+\t(_dispatch_get_tsd_base()->key)\n+#define _dispatch_thread_setspecific(key, value) \\\n+\t(void)(_dispatch_get_tsd_base()->key = (value))\n+\n+#define _dispatch_thread_getspecific_pair(k1, p1, k2, p2) \\\n+\t\t( *(p1) = _dispatch_thread_getspecific(k1), \\\n+\t\t  *(p2) = _dispatch_thread_getspecific(k2) )\n+\n+#define _dispatch_thread_getspecific_packed_pair(k1, k2, p) \\\n+\t\t( (p)[0] = _dispatch_thread_getspecific(k1), \\","path":"src/shims/tsd.h","position":59,"original_position":59,"commit_id":"03a7631cd244797e3985a982483a5737ea6c3b1f","original_commit_id":"03a7631cd244797e3985a982483a5737ea6c3b1f","user":{"login":"MadCoder","id":44708,"avatar_url":"https://avatars.githubusercontent.com/u/44708?v=3","gravatar_id":"","url":"https://api.github.com/users/MadCoder","html_url":"https://github.com/MadCoder","followers_url":"https://api.github.com/users/MadCoder/followers","following_url":"https://api.github.com/users/MadCoder/following{/other_user}","gists_url":"https://api.github.com/users/MadCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/MadCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadCoder/subscriptions","organizations_url":"https://api.github.com/users/MadCoder/orgs","repos_url":"https://api.github.com/users/MadCoder/repos","events_url":"https://api.github.com/users/MadCoder/events{/privacy}","received_events_url":"https://api.github.com/users/MadCoder/received_events","type":"User","site_admin":false},"body":"ditto","created_at":"2016-06-16T23:10:18Z","updated_at":"2016-06-16T23:10:18Z","html_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/82#discussion_r67439973","pull_request_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments/67439973"},"html":{"href":"https://github.com/apple/swift-corelibs-libdispatch/pull/82#discussion_r67439973"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82","id":74103276,"html_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/82","diff_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/82.diff","patch_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/82.patch","issue_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/82","number":82,"state":"open","locked":false,"title":"TLS: Thread Local Storage ","user":{"login":"frankeh","id":15785601,"avatar_url":"https://avatars.githubusercontent.com/u/15785601?v=3","gravatar_id":"","url":"https://api.github.com/users/frankeh","html_url":"https://github.com/frankeh","followers_url":"https://api.github.com/users/frankeh/followers","following_url":"https://api.github.com/users/frankeh/following{/other_user}","gists_url":"https://api.github.com/users/frankeh/gists{/gist_id}","starred_url":"https://api.github.com/users/frankeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankeh/subscriptions","organizations_url":"https://api.github.com/users/frankeh/orgs","repos_url":"https://api.github.com/users/frankeh/repos","events_url":"https://api.github.com/users/frankeh/events{/privacy}","received_events_url":"https://api.github.com/users/frankeh/received_events","type":"User","site_admin":false},"body":"Bring up previous patch for Thread Local Storage utilization over explicit keys to 685 base.","created_at":"2016-06-16T15:38:32Z","updated_at":"2016-06-16T23:10:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3453e8b85dfac480a8cd0d166cdb05dad8d5882","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82/commits","review_comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82/comments","review_comment_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/82/comments","statuses_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/03a7631cd244797e3985a982483a5737ea6c3b1f","head":{"label":"frankeh:TLS","ref":"TLS","sha":"03a7631cd244797e3985a982483a5737ea6c3b1f","user":{"login":"frankeh","id":15785601,"avatar_url":"https://avatars.githubusercontent.com/u/15785601?v=3","gravatar_id":"","url":"https://api.github.com/users/frankeh","html_url":"https://github.com/frankeh","followers_url":"https://api.github.com/users/frankeh/followers","following_url":"https://api.github.com/users/frankeh/following{/other_user}","gists_url":"https://api.github.com/users/frankeh/gists{/gist_id}","starred_url":"https://api.github.com/users/frankeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankeh/subscriptions","organizations_url":"https://api.github.com/users/frankeh/orgs","repos_url":"https://api.github.com/users/frankeh/repos","events_url":"https://api.github.com/users/frankeh/events{/privacy}","received_events_url":"https://api.github.com/users/frankeh/received_events","type":"User","site_admin":false},"repo":{"id":48249613,"name":"swift-corelibs-libdispatch","full_name":"frankeh/swift-corelibs-libdispatch","owner":{"login":"frankeh","id":15785601,"avatar_url":"https://avatars.githubusercontent.com/u/15785601?v=3","gravatar_id":"","url":"https://api.github.com/users/frankeh","html_url":"https://github.com/frankeh","followers_url":"https://api.github.com/users/frankeh/followers","following_url":"https://api.github.com/users/frankeh/following{/other_user}","gists_url":"https://api.github.com/users/frankeh/gists{/gist_id}","starred_url":"https://api.github.com/users/frankeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankeh/subscriptions","organizations_url":"https://api.github.com/users/frankeh/orgs","repos_url":"https://api.github.com/users/frankeh/repos","events_url":"https://api.github.com/users/frankeh/events{/privacy}","received_events_url":"https://api.github.com/users/frankeh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frankeh/swift-corelibs-libdispatch","description":"The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware","fork":true,"url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch","forks_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/forks","keys_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/teams","hooks_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/hooks","issue_events_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/events","assignees_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/tags","blobs_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/languages","stargazers_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/stargazers","contributors_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/contributors","subscribers_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/subscribers","subscription_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/subscription","commits_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/merges","archive_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/downloads","issues_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/labels{/name}","releases_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/releases{/id}","deployments_url":"https://api.github.com/repos/frankeh/swift-corelibs-libdispatch/deployments","created_at":"2015-12-18T18:15:52Z","updated_at":"2016-01-26T15:25:37Z","pushed_at":"2016-06-16T15:36:24Z","git_url":"git://github.com/frankeh/swift-corelibs-libdispatch.git","ssh_url":"git@github.com:frankeh/swift-corelibs-libdispatch.git","clone_url":"https://github.com/frankeh/swift-corelibs-libdispatch.git","svn_url":"https://github.com/frankeh/swift-corelibs-libdispatch","homepage":"swift.org","size":1037,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"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":"apple:master","ref":"master","sha":"2976fc4640c27408c42d8f4f9512acd0ad01421b","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":45863965,"name":"swift-corelibs-libdispatch","full_name":"apple/swift-corelibs-libdispatch","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-corelibs-libdispatch","description":"The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware","fork":false,"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch","forks_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/forks","keys_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/teams","hooks_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/events","assignees_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/tags","blobs_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/languages","stargazers_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/subscription","commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/merges","archive_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/downloads","issues_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/deployments","created_at":"2015-11-09T20:13:55Z","updated_at":"2016-06-16T22:41:56Z","pushed_at":"2016-06-16T21:46:45Z","git_url":"git://github.com/apple/swift-corelibs-libdispatch.git","ssh_url":"git@github.com:apple/swift-corelibs-libdispatch.git","clone_url":"https://github.com/apple/swift-corelibs-libdispatch.git","svn_url":"https://github.com/apple/swift-corelibs-libdispatch","homepage":"swift.org","size":1244,"stargazers_count":705,"watchers_count":705,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":8,"forks":100,"open_issues":8,"watchers":705,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82"},"html":{"href":"https://github.com/apple/swift-corelibs-libdispatch/pull/82"},"issue":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/82"},"comments":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/03a7631cd244797e3985a982483a5737ea6c3b1f"}}}}
{"actor":{"display_login":"MadCoder"}}