Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
3f0db081
Commit
3f0db081
authored
9 years ago
by
Nicolas Noble
Browse files
Options
Downloads
Plain Diff
Merge pull request #1614 from ctiller/make-tls-a-lil-sweeter
Guarantee tls_set returns the new value
parents
7f1e61fb
a33eca93
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/grpc/support/tls.h
+1
-1
1 addition, 1 deletion
include/grpc/support/tls.h
include/grpc/support/tls_pthread.h
+1
-1
1 addition, 1 deletion
include/grpc/support/tls_pthread.h
with
2 additions
and
2 deletions
include/grpc/support/tls.h
+
1
−
1
View file @
3f0db081
...
...
@@ -54,7 +54,7 @@
Destroying a thread local:
gpr_tls_destroy(&foo);
Setting a thread local:
Setting a thread local
(returns new_value)
:
gpr_tls_set(&foo, new_value);
Accessing a thread local:
...
...
This diff is collapsed.
Click to expand it.
include/grpc/support/tls_pthread.h
+
1
−
1
View file @
3f0db081
...
...
@@ -47,7 +47,7 @@ struct gpr_pthread_thread_local {
#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key)
#define gpr_tls_set(tls, new_value) \
GPR_ASSERT(pthread_setspecific((tls)->key, (void*)(new_value)) == 0)
(
GPR_ASSERT(pthread_setspecific((tls)->key, (void*)(new_value)) == 0)
, (new_value))
#define gpr_tls_get(tls) ((gpr_intptr)pthread_getspecific((tls)->key))
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment