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
822f1d75
Commit
822f1d75
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Add comment, tighten loop
parent
a45782f0
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/timer.c
+12
-3
12 additions, 3 deletions
src/core/iomgr/timer.c
with
12 additions
and
3 deletions
src/core/iomgr/timer.c
+
12
−
3
View file @
822f1d75
...
...
@@ -33,11 +33,11 @@
#include
"src/core/iomgr/timer.h"
#include
"src/core/iomgr/timer_heap.h"
#include
"src/core/iomgr/time_averaged_stats.h"
#include
<grpc/support/log.h>
#include
<grpc/support/sync.h>
#include
<grpc/support/useful.h>
#include
"src/core/iomgr/time_averaged_stats.h"
#include
"src/core/iomgr/timer_heap.h"
#define INVALID_HEAP_INDEX 0xffffffffu
...
...
@@ -331,8 +331,17 @@ static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now,
gpr_mu_unlock
(
&
g_mu
);
gpr_mu_unlock
(
&
g_checker_mu
);
}
else
if
(
next
!=
NULL
)
{
/* TODO(ctiller): this forces calling code to do an short poll, and
then retry the timer check (because this time through the timer list was
contended).
We could reduce the cost here dramatically by keeping a count of how many
currently active pollers got through the uncontended case above
successfully, and waking up other pollers IFF that count drops to zero.
Once that count is in place, this entire else branch could disappear. */
*
next
=
gpr_time_min
(
*
next
,
gpr_time_add
(
now
,
gpr_time_from_millis
(
1
00
,
GPR_TIMESPAN
)));
*
next
,
gpr_time_add
(
now
,
gpr_time_from_millis
(
1
,
GPR_TIMESPAN
)));
}
return
(
int
)
n
;
...
...
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