aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_timing_pthread.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 18:30:49 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 18:30:49 +0000
commit50aa5b08d186be73c92a9c3494505b8833def7c1 (patch)
treec3bebcbf75074329e07a179a74f4d9b0daa19bad /res/res_timing_pthread.c
parentab6a6c0cf07f19ca93d5ce72475990d5fff5833d (diff)
- Make res_timing_pthread allow a max rate of 100/sec instead of 50/sec
- change the "timing test" CLI command to let you specify a timing rate to test git-svn-id: http://svn.digium.com/svn/asterisk/trunk@124023 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_timing_pthread.c')
-rw-r--r--res/res_timing_pthread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c
index ead2c2d90..cb6bce439 100644
--- a/res/res_timing_pthread.c
+++ b/res/res_timing_pthread.c
@@ -57,9 +57,8 @@ static struct ast_timing_functions pthread_timing_functions = {
.timer_get_event = pthread_timer_get_event,
};
-/* 1 tick / 20 ms */
-#define TIMING_INTERVAL 20
-#define MAX_RATE 50
+/* 1 tick / 10 ms */
+#define MAX_RATE 100
static struct ao2_container *pthread_timers;
#define PTHREAD_TIMER_BUCKETS 563
@@ -412,9 +411,9 @@ static void *do_timing(void *arg)
while (!timing_thread.stop) {
struct timespec ts = { 0, };
- ao2_callback(pthread_timers, 0, run_timer, NULL);
+ ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL);
- next_wakeup = ast_tvadd(next_wakeup, ast_tv(0, 10000));
+ next_wakeup = ast_tvadd(next_wakeup, ast_tv(0, 5000));
ts.tv_sec = next_wakeup.tv_sec;
ts.tv_nsec = next_wakeup.tv_usec * 1000;