aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/support/tls_test.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-22 12:33:20 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-22 12:33:20 -0700
commita82950e68318a6aab6fe894fa39f7fa616c4647b (patch)
tree7d02bd1e9e1cbae1f14ad4ad1e06d3ae81a96dfe /test/core/support/tls_test.c
parent8af4c337181322cc4fb396199c90f574cfb4163f (diff)
clang-format all core files
Diffstat (limited to 'test/core/support/tls_test.c')
-rw-r--r--test/core/support/tls_test.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/test/core/support/tls_test.c b/test/core/support/tls_test.c
index 9c5cd54d63..0a3c28417f 100644
--- a/test/core/support/tls_test.c
+++ b/test/core/support/tls_test.c
@@ -43,48 +43,41 @@
#define NUM_THREADS 100
-GPR_TLS_DECL (test_var);
+GPR_TLS_DECL(test_var);
-static void
-thd_body (void *arg)
-{
+static void thd_body(void *arg) {
gpr_intptr i;
- GPR_ASSERT (gpr_tls_get (&test_var) == 0);
+ GPR_ASSERT(gpr_tls_get(&test_var) == 0);
- for (i = 0; i < 10000000; i++)
- {
- gpr_tls_set (&test_var, i);
- GPR_ASSERT (gpr_tls_get (&test_var) == i);
- }
- gpr_tls_set (&test_var, 0);
+ for (i = 0; i < 10000000; i++) {
+ gpr_tls_set(&test_var, i);
+ GPR_ASSERT(gpr_tls_get(&test_var) == i);
+ }
+ gpr_tls_set(&test_var, 0);
}
/* ------------------------------------------------- */
-int
-main (int argc, char *argv[])
-{
- gpr_thd_options opt = gpr_thd_options_default ();
+int main(int argc, char *argv[]) {
+ gpr_thd_options opt = gpr_thd_options_default();
int i;
gpr_thd_id threads[NUM_THREADS];
- grpc_test_init (argc, argv);
+ grpc_test_init(argc, argv);
- gpr_tls_init (&test_var);
+ gpr_tls_init(&test_var);
- gpr_thd_options_set_joinable (&opt);
+ gpr_thd_options_set_joinable(&opt);
- for (i = 0; i < NUM_THREADS; i++)
- {
- gpr_thd_new (&threads[i], thd_body, NULL, &opt);
- }
- for (i = 0; i < NUM_THREADS; i++)
- {
- gpr_thd_join (threads[i]);
- }
+ for (i = 0; i < NUM_THREADS; i++) {
+ gpr_thd_new(&threads[i], thd_body, NULL, &opt);
+ }
+ for (i = 0; i < NUM_THREADS; i++) {
+ gpr_thd_join(threads[i]);
+ }
- gpr_tls_destroy (&test_var);
+ gpr_tls_destroy(&test_var);
return 0;
}