summaryrefslogtreecommitdiff
path: root/pjlib/include/pj/os.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-09 15:37:19 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-09 15:37:19 +0000
commit6e1024262b48b57b771331b8c19e988e43627bd7 (patch)
treea43fdaeb6d7b22cc7afab1633622bf55d39dfd67 /pjlib/include/pj/os.h
parentfb9e3b3a6649cc5cbe0c6747cb1918f3be71ba06 (diff)
Rework pjlib++
git-svn-id: http://svn.pjsip.org/repos/pjproject/main@36 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/os.h')
-rw-r--r--pjlib/include/pj/os.h29
1 files changed, 29 insertions, 0 deletions
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);
/**
* @}