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
00ff7df7
Commit
00ff7df7
authored
9 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
Removed callback queue sync from iomgr.
parent
b8b59b18
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/iomgr/iomgr.c
+6
-6
6 additions, 6 deletions
src/core/iomgr/iomgr.c
with
6 additions
and
6 deletions
src/core/iomgr/iomgr.c
+
6
−
6
View file @
00ff7df7
...
@@ -50,7 +50,6 @@ typedef struct delayed_callback {
...
@@ -50,7 +50,6 @@ typedef struct delayed_callback {
}
delayed_callback
;
}
delayed_callback
;
static
gpr_mu
g_mu
;
static
gpr_mu
g_mu
;
static
gpr_cv
g_cv
;
static
gpr_cv
g_rcv
;
static
gpr_cv
g_rcv
;
static
delayed_callback
*
g_cbs_head
=
NULL
;
static
delayed_callback
*
g_cbs_head
=
NULL
;
static
delayed_callback
*
g_cbs_tail
=
NULL
;
static
delayed_callback
*
g_cbs_tail
=
NULL
;
...
@@ -64,6 +63,8 @@ static void background_callback_executor(void *ignored) {
...
@@ -64,6 +63,8 @@ static void background_callback_executor(void *ignored) {
gpr_mu_lock
(
&
g_mu
);
gpr_mu_lock
(
&
g_mu
);
while
(
!
g_shutdown
)
{
while
(
!
g_shutdown
)
{
gpr_timespec
deadline
=
gpr_inf_future
;
gpr_timespec
deadline
=
gpr_inf_future
;
gpr_timespec
short_deadline
=
gpr_time_add
(
gpr_now
(),
gpr_time_from_millis
(
100
));
if
(
g_cbs_head
)
{
if
(
g_cbs_head
)
{
delayed_callback
*
cb
=
g_cbs_head
;
delayed_callback
*
cb
=
g_cbs_head
;
g_cbs_head
=
cb
->
next
;
g_cbs_head
=
cb
->
next
;
...
@@ -74,19 +75,20 @@ static void background_callback_executor(void *ignored) {
...
@@ -74,19 +75,20 @@ static void background_callback_executor(void *ignored) {
gpr_mu_lock
(
&
g_mu
);
gpr_mu_lock
(
&
g_mu
);
}
else
if
(
grpc_alarm_check
(
&
g_mu
,
gpr_now
(),
&
deadline
))
{
}
else
if
(
grpc_alarm_check
(
&
g_mu
,
gpr_now
(),
&
deadline
))
{
}
else
{
}
else
{
gpr_cv_wait
(
&
g_cv
,
&
g_mu
,
deadline
);
gpr_mu_unlock
(
&
g_mu
);
gpr_sleep_until
(
gpr_time_min
(
short_deadline
,
deadline
));
gpr_mu_lock
(
&
g_mu
);
}
}
}
}
gpr_mu_unlock
(
&
g_mu
);
gpr_mu_unlock
(
&
g_mu
);
gpr_event_set
(
&
g_background_callback_executor_done
,
(
void
*
)
1
);
gpr_event_set
(
&
g_background_callback_executor_done
,
(
void
*
)
1
);
}
}
void
grpc_kick_poller
(
void
)
{
gpr_cv_broadcast
(
&
g_cv
);
}
void
grpc_kick_poller
(
void
)
{
}
void
grpc_iomgr_init
(
void
)
{
void
grpc_iomgr_init
(
void
)
{
gpr_thd_id
id
;
gpr_thd_id
id
;
gpr_mu_init
(
&
g_mu
);
gpr_mu_init
(
&
g_mu
);
gpr_cv_init
(
&
g_cv
);
gpr_cv_init
(
&
g_rcv
);
gpr_cv_init
(
&
g_rcv
);
grpc_alarm_list_init
(
gpr_now
());
grpc_alarm_list_init
(
gpr_now
());
g_refs
=
0
;
g_refs
=
0
;
...
@@ -143,7 +145,6 @@ void grpc_iomgr_shutdown(void) {
...
@@ -143,7 +145,6 @@ void grpc_iomgr_shutdown(void) {
grpc_iomgr_platform_shutdown
();
grpc_iomgr_platform_shutdown
();
grpc_alarm_list_shutdown
();
grpc_alarm_list_shutdown
();
gpr_mu_destroy
(
&
g_mu
);
gpr_mu_destroy
(
&
g_mu
);
gpr_cv_destroy
(
&
g_cv
);
gpr_cv_destroy
(
&
g_rcv
);
gpr_cv_destroy
(
&
g_rcv
);
}
}
...
@@ -175,7 +176,6 @@ void grpc_iomgr_add_delayed_callback(grpc_iomgr_cb_func cb, void *cb_arg,
...
@@ -175,7 +176,6 @@ void grpc_iomgr_add_delayed_callback(grpc_iomgr_cb_func cb, void *cb_arg,
g_cbs_tail
->
next
=
dcb
;
g_cbs_tail
->
next
=
dcb
;
g_cbs_tail
=
dcb
;
g_cbs_tail
=
dcb
;
}
}
gpr_cv_signal
(
&
g_cv
);
gpr_mu_unlock
(
&
g_mu
);
gpr_mu_unlock
(
&
g_mu
);
}
}
...
...
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