Kaynağa Gözat

Rename timer* to evtimer*.

master
Richard Nyberg 16 yıl önce
ebeveyn
işleme
c6f129faf7
11 değiştirilmiş dosya ile 23 ekleme ve 23 silme
  1. +1
    -1
      btpd/btpd.c
  2. +1
    -1
      btpd/content.c
  3. +1
    -1
      btpd/http_tr_if.c
  4. +1
    -1
      btpd/tracker_req.c
  5. +1
    -1
      btpd/upload.c
  6. +2
    -2
      btpd/util.c
  7. +2
    -2
      evloop/epoll.c
  8. +5
    -5
      evloop/evloop.h
  9. +2
    -2
      evloop/kqueue.c
  10. +2
    -2
      evloop/poll.c
  11. +5
    -5
      evloop/timer.c

+ 1
- 1
btpd/btpd.c Dosyayı Görüntüle

@@ -130,6 +130,6 @@ btpd_init(void)
tr_init();
tlib_init();

timer_init(&m_heartbeat, heartbeat_cb, NULL);
evtimer_init(&m_heartbeat, heartbeat_cb, NULL);
btpd_timer_add(&m_heartbeat, (& (struct timespec) { 1, 0 }));
}

+ 1
- 1
btpd/content.c Dosyayı Görüntüle

@@ -539,5 +539,5 @@ cm_start(struct torrent *tp, int force_test)
void
cm_init(void)
{
timer_init(&m_workev, worker_cb, NULL);
evtimer_init(&m_workev, worker_cb, NULL);
}

+ 1
- 1
btpd/http_tr_if.c Dosyayı Görüntüle

@@ -239,7 +239,7 @@ httptr_req(struct torrent *tp, struct tr_tier *tr, const char *aurl,
http_url = http_url_get(treq->req);
treq->nc = btpd_name_connect(http_url->host, http_url->port,
httptr_nc_cb, treq);
timer_init(&treq->timer, httptr_io_cb, treq);
evtimer_init(&treq->timer, httptr_io_cb, treq);
btpd_timer_add(&treq->timer, (& (struct timespec) { 60, 0 }));
return treq;
}


+ 1
- 1
btpd/tracker_req.c Dosyayı Görüntüle

@@ -163,7 +163,7 @@ tier_create(struct torrent *tp, struct mi_tier *tier)
t->tp = tp;
t->interval = -1;
t->event = TR_EV_STOPPED;
timer_init(&t->timer, tier_timer_cb, t);
evtimer_init(&t->timer, tier_timer_cb, t);
return t;
} else {
free(t);


+ 1
- 1
btpd/upload.c Dosyayı Görüntüle

@@ -190,6 +190,6 @@ ul_init(void)
m_max_uploads = 5 + (net_bw_limit_out / (100 << 10));
}

timer_init(&m_choke_timer, choke_cb, NULL);
evtimer_init(&m_choke_timer, choke_cb, NULL);
btpd_timer_add(&m_choke_timer, CHOKE_INTERVAL);
}

+ 2
- 2
btpd/util.c Dosyayı Görüntüle

@@ -52,14 +52,14 @@ btpd_ev_disable(struct fdev *ev, uint16_t flags)
void
btpd_timer_add(struct timeout *to, struct timespec *ts)
{
if (timer_add(to, ts) != 0)
if (evtimer_add(to, ts) != 0)
btpd_err("Failed to add timeout (%s).\n", strerror(errno));
}

void
btpd_timer_del(struct timeout *to)
{
timer_del(to);
evtimer_del(to);
}

static const char *


+ 2
- 2
evloop/epoll.c Dosyayı Görüntüle

@@ -84,8 +84,8 @@ evloop(void)
int nev, i, millisecs;
struct timespec delay;
while (1) {
timers_run();
delay = timer_delay();
evtimers_run();
delay = evtimer_delay();
if (delay.tv_sec >= 0)
millisecs = delay.tv_sec * 1000 + delay.tv_nsec / 1000000;
else


+ 5
- 5
evloop/evloop.h Dosyayı Görüntüle

@@ -47,11 +47,11 @@ int fdev_del(struct fdev *ev);
int fdev_enable(struct fdev *ev, uint16_t flags);
int fdev_disable(struct fdev *ev, uint16_t flags);

void timer_init(struct timeout *, evloop_cb_t, void *);
int timer_add(struct timeout *, struct timespec *);
void timer_del(struct timeout *);
void evtimer_init(struct timeout *, evloop_cb_t, void *);
int evtimer_add(struct timeout *, struct timespec *);
void evtimer_del(struct timeout *);

void timers_run(void);
struct timespec timer_delay(void);
void evtimers_run(void);
struct timespec evtimer_delay(void);

#endif

+ 2
- 2
evloop/kqueue.c Dosyayı Görüntüle

@@ -89,8 +89,8 @@ evloop(void)
int nev, i;
struct timespec delay;
while (1) {
timers_run();
delay = timer_delay();
evtimers_run();
delay = evtimer_delay();

if ((nev = kevent(m_kq, NULL, 0, m_evs, 100, &delay)) < 0) {
if (errno == EINTR)


+ 2
- 2
evloop/poll.c Dosyayı Görüntüle

@@ -107,9 +107,9 @@ evloop(void)
int millisecs;
struct timespec delay;
while (1) {
timers_run();
evtimers_run();

delay = timer_delay();
delay = evtimer_delay();
if (delay.tv_sec >= 0)
millisecs = delay.tv_sec * 1000 + delay.tv_nsec / 1000000;
else


+ 5
- 5
evloop/timer.c Dosyayı Görüntüle

@@ -38,7 +38,7 @@ subtime(struct timespec a, struct timespec b)
}

void
timer_init(struct timeout *h, evloop_cb_t cb, void *arg)
evtimer_init(struct timeout *h, evloop_cb_t cb, void *arg)
{
h->cb = cb;
h->arg = arg;
@@ -47,7 +47,7 @@ timer_init(struct timeout *h, evloop_cb_t cb, void *arg)
}

int
timer_add(struct timeout *h, struct timespec *t)
evtimer_add(struct timeout *h, struct timespec *t)
{
struct timespec now, sum;
clock_gettime(TIMER_CLOCK, &now);
@@ -61,7 +61,7 @@ timer_add(struct timeout *h, struct timespec *t)
}

void
timer_del(struct timeout *h)
evtimer_del(struct timeout *h)
{
if (h->th.i >= 0) {
timeheap_remove(&h->th);
@@ -70,7 +70,7 @@ timer_del(struct timeout *h)
}

void
timers_run(void)
evtimers_run(void)
{
struct timespec now;
clock_gettime(TIMER_CLOCK, &now);
@@ -86,7 +86,7 @@ timers_run(void)
}

struct timespec
timer_delay(void)
evtimer_delay(void)
{
struct timespec now, diff;
if (timeheap_size() == 0) {


Yükleniyor…
İptal
Kaydet