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
a25e6de0
Commit
a25e6de0
authored
9 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
fd_posix: removed redundant on_done
parent
07997b6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/iomgr/fd_posix.c
+6
-9
6 additions, 9 deletions
src/core/iomgr/fd_posix.c
src/core/iomgr/fd_posix.h
+2
-4
2 additions, 4 deletions
src/core/iomgr/fd_posix.h
with
8 additions
and
13 deletions
src/core/iomgr/fd_posix.c
+
6
−
9
View file @
a25e6de0
...
@@ -117,10 +117,7 @@ static void ref_by(grpc_fd *fd, int n) {
...
@@ -117,10 +117,7 @@ static void ref_by(grpc_fd *fd, int n) {
static
void
unref_by
(
grpc_fd
*
fd
,
int
n
)
{
static
void
unref_by
(
grpc_fd
*
fd
,
int
n
)
{
gpr_atm
old
=
gpr_atm_full_fetch_add
(
&
fd
->
refst
,
-
n
);
gpr_atm
old
=
gpr_atm_full_fetch_add
(
&
fd
->
refst
,
-
n
);
if
(
old
==
n
)
{
if
(
old
==
n
)
{
close
(
fd
->
fd
);
grpc_iomgr_add_callback
(
&
fd
->
on_done_closure
);
grpc_iomgr_closure_init
(
&
fd
->
on_done_iocb
,
fd
->
on_done
,
fd
->
on_done_user_data
);
grpc_iomgr_add_callback
(
&
fd
->
on_done_iocb
);
freelist_fd
(
fd
);
freelist_fd
(
fd
);
grpc_iomgr_unref
();
grpc_iomgr_unref
();
}
else
{
}
else
{
...
@@ -183,8 +180,8 @@ static void wake_all_watchers_locked(grpc_fd *fd) {
...
@@ -183,8 +180,8 @@ static void wake_all_watchers_locked(grpc_fd *fd) {
}
}
void
grpc_fd_orphan
(
grpc_fd
*
fd
,
grpc_iomgr_cb_func
on_done
,
void
*
user_data
)
{
void
grpc_fd_orphan
(
grpc_fd
*
fd
,
grpc_iomgr_cb_func
on_done
,
void
*
user_data
)
{
fd
->
on_done
=
on_done
?
on_done
:
do_nothing
;
grpc_iomgr_closure_init
(
&
fd
->
on_done
_closure
,
on_done
?
on_done
:
do_nothing
,
fd
->
on_done_user_data
=
user_data
;
user_data
)
;
shutdown
(
fd
->
fd
,
SHUT_RDWR
);
shutdown
(
fd
->
fd
,
SHUT_RDWR
);
ref_by
(
fd
,
1
);
/* remove active status, but keep referenced */
ref_by
(
fd
,
1
);
/* remove active status, but keep referenced */
gpr_mu_lock
(
&
fd
->
watcher_mu
);
gpr_mu_lock
(
&
fd
->
watcher_mu
);
...
@@ -303,11 +300,11 @@ void grpc_fd_shutdown(grpc_fd *fd) {
...
@@ -303,11 +300,11 @@ void grpc_fd_shutdown(grpc_fd *fd) {
gpr_mu_lock
(
&
fd
->
set_state_mu
);
gpr_mu_lock
(
&
fd
->
set_state_mu
);
GPR_ASSERT
(
!
gpr_atm_no_barrier_load
(
&
fd
->
shutdown
));
GPR_ASSERT
(
!
gpr_atm_no_barrier_load
(
&
fd
->
shutdown
));
gpr_atm_rel_store
(
&
fd
->
shutdown
,
1
);
gpr_atm_rel_store
(
&
fd
->
shutdown
,
1
);
set_ready_locked
(
&
fd
->
readst
,
fd
->
shutdown_
iocb
s
,
&
ncb
);
set_ready_locked
(
&
fd
->
readst
,
fd
->
shutdown_
closure
s
,
&
ncb
);
set_ready_locked
(
&
fd
->
writest
,
fd
->
shutdown_
iocb
s
,
&
ncb
);
set_ready_locked
(
&
fd
->
writest
,
fd
->
shutdown_
closure
s
,
&
ncb
);
gpr_mu_unlock
(
&
fd
->
set_state_mu
);
gpr_mu_unlock
(
&
fd
->
set_state_mu
);
GPR_ASSERT
(
ncb
<=
2
);
GPR_ASSERT
(
ncb
<=
2
);
process_callbacks
(
fd
->
shutdown_
iocb
s
,
ncb
,
0
,
0
);
process_callbacks
(
fd
->
shutdown_
closure
s
,
ncb
,
0
,
0
);
}
}
void
grpc_fd_notify_on_read
(
grpc_fd
*
fd
,
grpc_iomgr_closure
*
closure
)
{
void
grpc_fd_notify_on_read
(
grpc_fd
*
fd
,
grpc_iomgr_closure
*
closure
)
{
...
...
This diff is collapsed.
Click to expand it.
src/core/iomgr/fd_posix.h
+
2
−
4
View file @
a25e6de0
...
@@ -91,12 +91,10 @@ struct grpc_fd {
...
@@ -91,12 +91,10 @@ struct grpc_fd {
gpr_atm
readst
;
gpr_atm
readst
;
gpr_atm
writest
;
gpr_atm
writest
;
grpc_iomgr_cb_func
on_done
;
void
*
on_done_user_data
;
struct
grpc_fd
*
freelist_next
;
struct
grpc_fd
*
freelist_next
;
grpc_iomgr_closure
on_done_
iocb
;
grpc_iomgr_closure
on_done_
closure
;
grpc_iomgr_closure
shutdown_
iocb
s
[
2
];
grpc_iomgr_closure
shutdown_
closure
s
[
2
];
};
};
/* Create a wrapped file descriptor.
/* Create a wrapped file descriptor.
...
...
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