-
Notifications
You must be signed in to change notification settings - Fork 469
TLS: Thread Local Storage #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -63,3 +64,8 @@ unsigned short dispatch_callout__return_semaphore; | |||
unsigned short dispatch_queue__push_semaphore; | |||
void (*_dispatch_block_special_invoke)(void*); | |||
struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent; | |||
|
|||
#if DISPATCH_USE_THREAD_LOCAL_STORAGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should move in init.c
done with the first round of comments. |
_dispatch_get_tsd_base(void) | ||
{ | ||
if (slowpath(!__dispatch_tsd.initialized)) { | ||
libdispatch_tsd_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a OS_COMPILER_CAN_ASSUME(__dispatch_tsd.tid != 0)
may help clang to also not call that lazy init several times for the cases when several TSD accesses are performed
Besides the other two comments: |
Finally DISPATCH_PURE on libdispatch_tsd_init results in crashes (verified with only that change). |
ok we can keep libdispatch_tsd_cleanup() in queue.c then. |
the patch looks good beside cleaning up |
I just merged #86 so please rebase, squash and address the remaining comments |
Rebase squashed based on the comments you had left and we fixed. (thanx) |
\o/ |
TLS: Thread Local Storage Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Bring up previous patch for Thread Local Storage utilization over explicit keys to 685 base.