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
3d48c99c
Commit
3d48c99c
authored
Nov 15, 2016
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Minor boolification.
parent
2ea37e90
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/ext/client_channel/subchannel.c
+9
-11
9 additions, 11 deletions
src/core/ext/client_channel/subchannel.c
with
9 additions
and
11 deletions
src/core/ext/client_channel/subchannel.c
+
9
−
11
View file @
3d48c99c
...
...
@@ -119,9 +119,9 @@ struct grpc_subchannel {
gpr_mu
mu
;
/** have we seen a disconnection? */
int
disconnected
;
bool
disconnected
;
/** are we connecting */
int
connecting
;
bool
connecting
;
/** connectivity state tracking */
grpc_connectivity_state_tracker
state_tracker
;
...
...
@@ -132,7 +132,7 @@ struct grpc_subchannel {
/** backoff state */
gpr_backoff
backoff_state
;
/** do we have an active alarm? */
int
have_alarm
;
bool
have_alarm
;
/** our alarm */
grpc_timer
alarm
;
};
...
...
@@ -264,7 +264,7 @@ static void disconnect(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
grpc_subchannel_index_unregister
(
exec_ctx
,
c
->
key
,
c
);
gpr_mu_lock
(
&
c
->
mu
);
GPR_ASSERT
(
!
c
->
disconnected
);
c
->
disconnected
=
1
;
c
->
disconnected
=
true
;
grpc_connector_shutdown
(
exec_ctx
,
c
->
connector
);
con
=
GET_CONNECTED_SUBCHANNEL
(
c
,
no_barrier
);
if
(
con
!=
NULL
)
{
...
...
@@ -451,7 +451,7 @@ void grpc_subchannel_notify_on_state_change(
w
->
next
->
prev
=
w
->
prev
->
next
=
w
;
if
(
grpc_connectivity_state_notify_on_state_change
(
exec_ctx
,
&
c
->
state_tracker
,
state
,
&
w
->
closure
))
{
c
->
connecting
=
1
;
c
->
connecting
=
true
;
/* released by connection */
GRPC_SUBCHANNEL_WEAK_REF
(
c
,
"connecting"
);
start_connect
(
exec_ctx
,
c
);
...
...
@@ -575,12 +575,10 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
Re-evaluate if we really need this. */
gpr_atm_full_barrier
();
GPR_ASSERT
(
gpr_atm_rel_cas
(
&
c
->
connected_subchannel
,
0
,
(
gpr_atm
)
con
));
c
->
connecting
=
0
;
c
->
connecting
=
false
;
/* setup subchannel watching connected subchannel for changes; subchannel
ref
for connecting is donated
to the state watcher */
ref for connecting is donated to the state watcher */
GRPC_SUBCHANNEL_WEAK_REF
(
c
,
"state_watcher"
);
GRPC_SUBCHANNEL_WEAK_UNREF
(
exec_ctx
,
c
,
"connecting"
);
grpc_connected_subchannel_notify_on_state_change
(
...
...
@@ -595,7 +593,7 @@ static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
static
void
on_alarm
(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
grpc_error
*
error
)
{
grpc_subchannel
*
c
=
arg
;
gpr_mu_lock
(
&
c
->
mu
);
c
->
have_alarm
=
0
;
c
->
have_alarm
=
false
;
if
(
c
->
disconnected
)
{
error
=
GRPC_ERROR_CREATE_REFERENCING
(
"Disconnected"
,
&
error
,
1
);
}
else
{
...
...
@@ -628,7 +626,7 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
}
else
{
gpr_timespec
now
=
gpr_now
(
GPR_CLOCK_MONOTONIC
);
GPR_ASSERT
(
!
c
->
have_alarm
);
c
->
have_alarm
=
1
;
c
->
have_alarm
=
true
;
grpc_connectivity_state_set
(
exec_ctx
,
&
c
->
state_tracker
,
GRPC_CHANNEL_TRANSIENT_FAILURE
,
grpc_error_set_int
(
...
...
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