Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
ac1b627e
Commit
ac1b627e
authored
11 years ago
by
Andrea Shepard
Browse files
Options
Downloads
Patches
Plain Diff
Implement scheduler_touch_channel()
parent
ed1927d6
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/or/scheduler.c
+24
-0
24 additions, 0 deletions
src/or/scheduler.c
src/or/scheduler.h
+3
-0
3 additions, 0 deletions
src/or/scheduler.h
with
27 additions
and
0 deletions
src/or/scheduler.c
+
24
−
0
View file @
ac1b627e
...
...
@@ -579,6 +579,30 @@ scheduler_channel_wants_writes(channel_t *chan)
if
(
became_pending
)
scheduler_retrigger
();
}
/**
* Notify the scheduler that a channel's position in the pqueue may have
* changed
*/
void
scheduler_touch_channel
(
channel_t
*
chan
)
{
tor_assert
(
chan
);
if
(
chan
->
scheduler_state
==
SCHED_CHAN_PENDING
)
{
/* Remove and re-add it */
smartlist_pqueue_remove
(
channels_pending
,
scheduler_compare_channels
,
STRUCT_OFFSET
(
channel_t
,
sched_heap_idx
),
chan
);
smartlist_pqueue_add
(
channels_pending
,
scheduler_compare_channels
,
STRUCT_OFFSET
(
channel_t
,
sched_heap_idx
),
chan
);
}
/* else no-op, since it isn't in the queue */
}
/**
* Notify the scheduler of a queue size adjustment, to recalculate the
* queue heuristic.
...
...
This diff is collapsed.
Click to expand it.
src/or/scheduler.h
+
3
−
0
View file @
ac1b627e
...
...
@@ -30,5 +30,8 @@ void scheduler_release_channel(channel_t *chan);
/* Notify scheduler of queue size adjustments */
void
scheduler_adjust_queue_size
(
channel_t
*
chan
,
char
dir
,
uint64_t
adj
);
/* Notify scheduler that a channel's queue position may have changed */
void
scheduler_touch_channel
(
channel_t
*
chan
);
#endif
/* !defined(TOR_SCHEDULER_H) */
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