diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-12-01 16:40:04 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-12-01 16:40:04 +0300 |
commit | 574912df113888ea19b4811b406612544514d9eb (patch) | |
tree | a7fec6d150d8710b31d4730ef7fab5c4c9ce4417 /accel-pppd/triton/timer.c | |
parent | 3cc7fd0165e096be25761710b66b44fda9d09190 (diff) | |
parent | e09279c7491a8bd16a25b123e03ddd0cd77b566d (diff) | |
download | accel-ppp-574912df113888ea19b4811b406612544514d9eb.tar.gz accel-ppp-574912df113888ea19b4811b406612544514d9eb.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/code
Diffstat (limited to 'accel-pppd/triton/timer.c')
-rw-r--r-- | accel-pppd/triton/timer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/accel-pppd/triton/timer.c b/accel-pppd/triton/timer.c index 1e4f0612..18599ef3 100644 --- a/accel-pppd/triton/timer.c +++ b/accel-pppd/triton/timer.c @@ -85,7 +85,7 @@ void *timer_thread(void *arg) triton_log_error("timer:epoll_wait: %s", strerror(errno)); _exit(-1); } - + for(i = 0; i < n; i++) { t = (struct _triton_timer_t *)epoll_events[i].data.ptr; if (!t->ud) @@ -141,21 +141,21 @@ int __export triton_timer_add(struct triton_context_t *ctx, struct triton_timer_ return -1; } - if (fcntl(t->fd, F_SETFL, O_NONBLOCK)) { + if (fcntl(t->fd, F_SETFL, O_NONBLOCK)) { triton_log_error("timer: failed to set nonblocking mode: %s", strerror(errno)); goto out_err; } - + __sync_add_and_fetch(&t->ctx->refs, 1); ud->tpd = t; if (triton_timer_mod(ud, abs_time)) goto out_err; - + spin_lock(&t->ctx->lock); list_add_tail(&t->entry, &t->ctx->timers); spin_unlock(&t->ctx->lock); - + if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, t->fd, &t->epoll_event)) { triton_log_error("timer:epoll_ctl: %s", strerror(errno)); spin_lock(&t->ctx->lock); @@ -166,7 +166,7 @@ int __export triton_timer_add(struct triton_context_t *ctx, struct triton_timer_ } triton_stat.timer_count++; - + return 0; out_err: @@ -214,9 +214,9 @@ void __export triton_timer_del(struct triton_timer_t *ud) pthread_mutex_lock(&freed_list_lock); list_add_tail(&t->entry, &freed_list); pthread_mutex_unlock(&freed_list_lock); - + ud->tpd = NULL; - + triton_stat.timer_count--; } |