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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
b597dcf5
Commit
b597dcf5
authored
Mar 9, 2017
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Race fixes
parent
676db291
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/surface/call.c
+9
-9
9 additions, 9 deletions
src/core/lib/surface/call.c
with
9 additions
and
9 deletions
src/core/lib/surface/call.c
+
9
−
9
View file @
b597dcf5
...
@@ -161,8 +161,8 @@ struct grpc_call {
...
@@ -161,8 +161,8 @@ struct grpc_call {
bool
received_initial_metadata
;
bool
received_initial_metadata
;
bool
receiving_message
;
bool
receiving_message
;
bool
requested_final_op
;
bool
requested_final_op
;
bool
received_final_op
;
gpr_atm
any_ops_sent_atm
;
gpr_atm
num_ops_sent
;
gpr_atm
received_final_op_atm
;
/* have we received initial metadata */
/* have we received initial metadata */
bool
has_initial_md_been_received
;
bool
has_initial_md_been_received
;
...
@@ -458,7 +458,7 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call,
...
@@ -458,7 +458,7 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call,
for
(
i
=
0
;
i
<
STATUS_SOURCE_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
STATUS_SOURCE_COUNT
;
i
++
)
{
GRPC_ERROR_UNREF
(
GRPC_ERROR_UNREF
(
unpack_received_status
(
gpr_atm_
no_barrier
_load
(
&
c
->
status
[
i
])).
error
);
unpack_received_status
(
gpr_atm_
acq
_load
(
&
c
->
status
[
i
])).
error
);
}
}
grpc_call_stack_destroy
(
exec_ctx
,
CALL_STACK_FROM_CALL
(
c
),
&
c
->
final_info
,
c
);
grpc_call_stack_destroy
(
exec_ctx
,
CALL_STACK_FROM_CALL
(
c
),
&
c
->
final_info
,
c
);
...
@@ -490,7 +490,7 @@ void grpc_call_destroy(grpc_call *c) {
...
@@ -490,7 +490,7 @@ void grpc_call_destroy(grpc_call *c) {
GPR_ASSERT
(
!
c
->
destroy_called
);
GPR_ASSERT
(
!
c
->
destroy_called
);
c
->
destroy_called
=
1
;
c
->
destroy_called
=
1
;
cancel
=
gpr_atm_
no_barrier
_load
(
&
c
->
num
_ops_sent
)
&&
!
c
->
received_final_op
;
cancel
=
gpr_atm_
acq
_load
(
&
c
->
any
_ops_sent
_atm
)
&&
!
gpr_atm_acq_load
(
&
c
->
received_final_op
_atm
)
;
if
(
cancel
)
{
if
(
cancel
)
{
cancel_with_error
(
&
exec_ctx
,
c
,
STATUS_FROM_API_OVERRIDE
,
cancel_with_error
(
&
exec_ctx
,
c
,
STATUS_FROM_API_OVERRIDE
,
GRPC_ERROR_CANCELLED
);
GRPC_ERROR_CANCELLED
);
...
@@ -1048,7 +1048,7 @@ static void finish_batch_completion(grpc_exec_ctx *exec_ctx, void *user_data,
...
@@ -1048,7 +1048,7 @@ static void finish_batch_completion(grpc_exec_ctx *exec_ctx, void *user_data,
}
}
static
grpc_error
*
consolidate_batch_errors
(
batch_control
*
bctl
)
{
static
grpc_error
*
consolidate_batch_errors
(
batch_control
*
bctl
)
{
size_t
n
=
(
size_t
)
gpr_atm_
no_barrier
_load
(
&
bctl
->
num_errors
);
size_t
n
=
(
size_t
)
gpr_atm_
acq
_load
(
&
bctl
->
num_errors
);
if
(
n
==
0
)
{
if
(
n
==
0
)
{
return
GRPC_ERROR_NONE
;
return
GRPC_ERROR_NONE
;
}
else
if
(
n
==
1
)
{
}
else
if
(
n
==
1
)
{
...
@@ -1093,7 +1093,7 @@ static void post_batch_completion(grpc_exec_ctx *exec_ctx,
...
@@ -1093,7 +1093,7 @@ static void post_batch_completion(grpc_exec_ctx *exec_ctx,
&
call
->
metadata_batch
[
1
/* is_receiving */
][
1
/* is_trailing */
];
&
call
->
metadata_batch
[
1
/* is_receiving */
][
1
/* is_trailing */
];
recv_trailing_filter
(
exec_ctx
,
call
,
md
);
recv_trailing_filter
(
exec_ctx
,
call
,
md
);
call
->
received_final_op
=
true
;
gpr_atm_rel_store
(
&
call
->
received_final_op
_atm
,
1
)
;
/* propagate cancellation to any interested children */
/* propagate cancellation to any interested children */
if
(
gpr_atm_acq_load
(
&
call
->
has_children
))
{
if
(
gpr_atm_acq_load
(
&
call
->
has_children
))
{
gpr_mu_lock
(
&
call
->
child_list_mu
);
gpr_mu_lock
(
&
call
->
child_list_mu
);
...
@@ -1286,7 +1286,7 @@ static void validate_filtered_metadata(grpc_exec_ctx *exec_ctx,
...
@@ -1286,7 +1286,7 @@ static void validate_filtered_metadata(grpc_exec_ctx *exec_ctx,
static
void
add_batch_error
(
grpc_exec_ctx
*
exec_ctx
,
batch_control
*
bctl
,
static
void
add_batch_error
(
grpc_exec_ctx
*
exec_ctx
,
batch_control
*
bctl
,
grpc_error
*
error
,
bool
has_cancelled
)
{
grpc_error
*
error
,
bool
has_cancelled
)
{
if
(
error
==
GRPC_ERROR_NONE
)
return
;
if
(
error
==
GRPC_ERROR_NONE
)
return
;
int
idx
=
(
int
)
gpr_atm_
no_barrier
_fetch_add
(
&
bctl
->
num_errors
,
1
);
int
idx
=
(
int
)
gpr_atm_
full
_fetch_add
(
&
bctl
->
num_errors
,
1
);
if
(
idx
==
0
&&
!
has_cancelled
)
{
if
(
idx
==
0
&&
!
has_cancelled
)
{
cancel_with_error
(
exec_ctx
,
bctl
->
call
,
STATUS_FROM_CORE
,
cancel_with_error
(
exec_ctx
,
bctl
->
call
,
STATUS_FROM_CORE
,
GRPC_ERROR_REF
(
error
));
GRPC_ERROR_REF
(
error
));
...
@@ -1664,7 +1664,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
...
@@ -1664,7 +1664,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
grpc_closure_init
(
&
bctl
->
finish_batch
,
finish_batch
,
bctl
,
grpc_closure_init
(
&
bctl
->
finish_batch
,
finish_batch
,
bctl
,
grpc_schedule_on_exec_ctx
);
grpc_schedule_on_exec_ctx
);
stream_op
->
on_complete
=
&
bctl
->
finish_batch
;
stream_op
->
on_complete
=
&
bctl
->
finish_batch
;
gpr_atm_
no_barrier_fetch_add
(
&
call
->
num
_ops_sent
,
1
);
gpr_atm_
rel_store
(
&
call
->
any
_ops_sent
_atm
,
1
);
execute_op
(
exec_ctx
,
call
,
stream_op
);
execute_op
(
exec_ctx
,
call
,
stream_op
);
...
...
...
...
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
sign in
to comment