From 491da20dbf296d9fdf44ae5fffde54f254059f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 19 Sep 2008 09:11:12 +0000 Subject: [PATCH] * Added a is_timer_running() function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27631 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/net/net_stack.h | 1 + src/add-ons/kernel/network/stack/stack.cpp | 1 + src/add-ons/kernel/network/stack/utility.cpp | 7 +++++++ src/add-ons/kernel/network/stack/utility.h | 1 + 4 files changed, 10 insertions(+) diff --git a/headers/private/net/net_stack.h b/headers/private/net/net_stack.h index b7ada2f0f9..16de4a4486 100644 --- a/headers/private/net/net_stack.h +++ b/headers/private/net/net_stack.h @@ -143,6 +143,7 @@ struct net_stack_module_info { bool (*cancel_timer)(struct net_timer *timer); status_t (*wait_for_timer)(struct net_timer *timer); bool (*is_timer_active)(struct net_timer *timer); + bool (*is_timer_running)(struct net_timer *timer); // syscall restart bool (*is_syscall)(void); diff --git a/src/add-ons/kernel/network/stack/stack.cpp b/src/add-ons/kernel/network/stack/stack.cpp index 27019a1b56..6f270ee6a2 100644 --- a/src/add-ons/kernel/network/stack/stack.cpp +++ b/src/add-ons/kernel/network/stack/stack.cpp @@ -915,6 +915,7 @@ net_stack_module_info gNetStackModule = { cancel_timer, wait_for_timer, is_timer_active, + is_timer_running, is_syscall, is_restarted_syscall, diff --git a/src/add-ons/kernel/network/stack/utility.cpp b/src/add-ons/kernel/network/stack/utility.cpp index 0f4dc0e4da..0742c66e91 100644 --- a/src/add-ons/kernel/network/stack/utility.cpp +++ b/src/add-ons/kernel/network/stack/utility.cpp @@ -571,6 +571,13 @@ is_timer_active(net_timer* timer) } +bool +is_timer_running(net_timer* timer) +{ + return timer == sCurrentTimer; +} + + static int dump_timer(int argc, char** argv) { diff --git a/src/add-ons/kernel/network/stack/utility.h b/src/add-ons/kernel/network/stack/utility.h index 3a12035537..242a84ac28 100644 --- a/src/add-ons/kernel/network/stack/utility.h +++ b/src/add-ons/kernel/network/stack/utility.h @@ -75,6 +75,7 @@ void set_timer(net_timer* timer, bigtime_t delay); bool cancel_timer(struct net_timer* timer); status_t wait_for_timer(struct net_timer* timer); bool is_timer_active(net_timer* timer); +bool is_timer_running(net_timer* timer); status_t init_timers(void); void uninit_timers(void);