From 8249f59293798cb27c1032f7f6a270afa455788d Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Fri, 6 Mar 2015 06:09:22 +0000 Subject: Fixed #1821: Remove unnecessary locking in pjsip transaction and add new API to create a group lock with handler in a single atomic instruction git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4992 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/lock.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'pjlib/include') diff --git a/pjlib/include/pj/lock.h b/pjlib/include/pj/lock.h index b1a5d72e..415ea951 100644 --- a/pjlib/include/pj/lock.h +++ b/pjlib/include/pj/lock.h @@ -217,6 +217,27 @@ PJ_DECL(pj_status_t) pj_grp_lock_create(pj_pool_t *pool, const pj_grp_lock_config *cfg, pj_grp_lock_t **p_grp_lock); +/** + * Create a group lock object, with the specified destructor handler, to be + * called by the group lock when it is about to be destroyed. Initially the + * group lock will have reference counter of one. + * + * @param pool The group lock only uses the pool parameter to get + * the pool factory, from which it will create its own + * pool. + * @param cfg Optional configuration. + * @param member A pointer to be passed to the handler. + * @param handler The destroy handler. + * @param p_grp_lock Pointer to receive the newly created group lock. + * + * @return PJ_SUCCESS or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_grp_lock_create_w_handler(pj_pool_t *pool, + const pj_grp_lock_config *cfg, + void *member, + void (*handler)(void *member), + pj_grp_lock_t **p_grp_lock); + /** * Forcibly destroy the group lock, ignoring the reference counter value. * -- cgit v1.2.3