diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-07 22:39:30 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-07 22:39:30 +0000 |
commit | a7a95954c816e072bd44fb884029853a3585db33 (patch) | |
tree | 80eea1f19a98b0f9ca3ab09f32d0eea8aa0f85d5 /res/res_timing_pthread.c | |
parent | f7be936f69d32c2b9aedb70d25395cb51c01eea6 (diff) |
Add ability to pass arbitrary data to the ao2_callback_fn (called from
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either
of these mandates that the passed 'arg' is a hashable object, making
searching for an ao2 object based on outside criteria difficult.
Reviewed by Russell and Mark M. via ReviewBoard:
http://reviewboard.digium.com/r/36/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@155401 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_timing_pthread.c')
-rw-r--r-- | res/res_timing_pthread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 6e57246a6..4114e3677 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -268,7 +268,7 @@ static struct pthread_timer *find_timer(int handle, int unlinkobj) flags |= OBJ_UNLINK; } - if (!(timer = ao2_find(pthread_timers, &tmp_timer, flags))) { + if (!(timer = ao2_find(pthread_timers, &tmp_timer, NULL, flags))) { ast_assert(timer != NULL); return NULL; } @@ -304,7 +304,7 @@ static int pthread_timer_hash(const void *obj, const int flags) /*! * \note only PIPE_READ is guaranteed valid */ -static int pthread_timer_cmp(void *obj, void *arg, int flags) +static int pthread_timer_cmp(void *obj, void *arg, void *data, int flags) { struct pthread_timer *timer1 = obj, *timer2 = arg; @@ -396,7 +396,7 @@ static void write_byte(int wr_fd) } while (0); } -static int run_timer(void *obj, void *arg, int flags) +static int run_timer(void *obj, void *arg, void *data, int flags) { struct pthread_timer *timer = obj; @@ -422,7 +422,7 @@ static void *do_timing(void *arg) while (!timing_thread.stop) { struct timespec ts = { 0, }; - ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL); + ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL, NULL); next_wakeup = ast_tvadd(next_wakeup, ast_tv(0, 5000)); |