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 /main/taskprocessor.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 'main/taskprocessor.c')
-rw-r--r-- | main/taskprocessor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c index 6ed939b45..d8287257e 100644 --- a/main/taskprocessor.c +++ b/main/taskprocessor.c @@ -93,7 +93,7 @@ AST_MUTEX_DEFINE_STATIC(cli_ping_cond_lock); /*! \brief The astobj2 hash callback for taskprocessors */ static int tps_hash_cb(const void *obj, const int flags); /*! \brief The astobj2 compare callback for taskprocessors */ -static int tps_cmp_cb(void *obj, void *arg, int flags); +static int tps_cmp_cb(void *obj, void *arg, void *data, int flags); /*! \brief The task processing function executed by a taskprocessor */ static void *tps_processing_function(void *data); @@ -335,7 +335,7 @@ static int tps_hash_cb(const void *obj, const int flags) } /* compare callback for astobj2 */ -static int tps_cmp_cb(void *obj, void *arg, int flags) +static int tps_cmp_cb(void *obj, void *arg, void *data, int flags) { struct ast_taskprocessor *lhs = obj, *rhs = arg; @@ -415,7 +415,7 @@ struct ast_taskprocessor *ast_taskprocessor_get(char *name, enum ast_tps_options return NULL; } ao2_lock(tps_singletons); - p = ao2_find(tps_singletons, &tmp_tps, OBJ_POINTER); + p = ao2_find(tps_singletons, &tmp_tps, NULL, OBJ_POINTER); if (p) { ao2_unlock(tps_singletons); return p; |