diff options
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -907,3 +907,14 @@ void ast_enable_packet_fragmentation(int sock) #endif } +AST_MUTEX_DEFINE_STATIC(fetchadd_m); /* used for all fetc&add ops */ + +int ast_atomic_fetchadd_int_slow(volatile int *p, int v) +{ + int ret; + ast_mutex_lock(&fetchadd_m); + ret = *p; + *p += v; + ast_mutex_unlock(&fetchadd_m); + return ret; +} |