From 6e1024262b48b57b771331b8c19e988e43627bd7 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 9 Nov 2005 15:37:19 +0000 Subject: Rework pjlib++ git-svn-id: http://svn.pjsip.org/repos/pjproject/main@36 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/os.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'pjlib/include/pj/os.h') diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h index 536992f2..a1fef6b8 100644 --- a/pjlib/include/pj/os.h +++ b/pjlib/include/pj/os.h @@ -324,12 +324,30 @@ PJ_DECL(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var); */ PJ_DECL(void) pj_atomic_inc(pj_atomic_t *atomic_var); +/** + * Increment the value of an atomic type and get the result. + * + * @param atomic_var the atomic variable. + * + * @return The incremented value. + */ +PJ_DECL(pj_atomic_value_t) pj_atomic_inc_and_get(pj_atomic_t *atomic_var); + /** * Decrement the value of an atomic type. * * @param atomic_var the atomic variable. */ PJ_DECL(void) pj_atomic_dec(pj_atomic_t *atomic_var); + +/** + * Decrement the value of an atomic type and get the result. + * + * @param atomic_var the atomic variable. + * + * @return The decremented value. + */ +PJ_DECL(pj_atomic_value_t) pj_atomic_dec_and_get(pj_atomic_t *atomic_var); /** * Add a value to an atomic type. @@ -339,6 +357,17 @@ PJ_DECL(void) pj_atomic_dec(pj_atomic_t *atomic_var); */ PJ_DECL(void) pj_atomic_add( pj_atomic_t *atomic_var, pj_atomic_value_t value); + +/** + * Add a value to an atomic type and get the result. + * + * @param atomic_var The atomic variable. + * @param value Value to be added. + * + * @return The result after the addition. + */ +PJ_DECL(pj_atomic_value_t) pj_atomic_add_and_get( pj_atomic_t *atomic_var, + pj_atomic_value_t value); /** * @} -- cgit v1.2.3