aboutsummaryrefslogtreecommitdiff
path: root/src/or/scheduler.h
blob: 0752ae0760179471826fa6c2012ba4ce1f0ca7e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* * Copyright (c) 2013, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * \file scheduler.h
 * \brief Header file for scheduler.c
 **/

#ifndef TOR_SCHEDULER_H
#define TOR_SCHEDULER_H

#include "or.h"
#include "channel.h"
#include "testsupport.h"

/* Global-visibility scheduler functions */

/* Set up and shut down the scheduler from main.c */
void scheduler_free_all(void);
void scheduler_init(void);
void scheduler_run(void);

/* Mark channels as having cells or wanting/not wanting writes */
MOCK_DECL(void,scheduler_channel_doesnt_want_writes,(channel_t *chan));
void scheduler_channel_has_waiting_cells(channel_t *chan);
void scheduler_channel_wants_writes(channel_t *chan);

/* Notify the scheduler of a channel being closed */
MOCK_DECL(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) */