mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 07:04:17 +00:00
FS-3173
This commit is contained in:
1 parent
fd6089014e
commit
3b56c119a7
2 files changed
+112
-1
No files matched your search
+52
-1
@@ -24,7 +24,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
* Michael Jerris <mike@jerris.com>
|
||||
*
|
||||
* Eliot Gable <egable@gmail.com>
|
||||
*
|
||||
* switch_apr.c -- apr wrappers and extensions
|
||||
*
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
/* apr headers*/
|
||||
#include <apr.h>
|
||||
#include <apr_atomic.h>
|
||||
#include <apr_pools.h>
|
||||
#include <apr_hash.h>
|
||||
#include <apr_network_io.h>
|
||||
@@ -1141,6 +1142,56 @@ SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, swit
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_atomic_init(switch_memory_pool_t *pool)
|
||||
{
|
||||
return apr_atomic_init((apr_pool_t *) pool);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_atomic_read(volatile switch_atomic_t *mem)
|
||||
{
|
||||
#ifdef apr_atomic_t
|
||||
return apr_atomic_read((apr_atomic_t *)mem);
|
||||
#else
|
||||
return apr_atomic_read32((apr_uint32_t *)mem);
|
||||
#endif
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_atomic_set(volatile switch_atomic_t *mem, uint32_t val)
|
||||
{
|
||||
#ifdef apr_atomic_t
|
||||
apr_atomic_set((apr_atomic_t *)mem, val);
|
||||
#else
|
||||
apr_atomic_set32((apr_uint32_t *)mem, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_atomic_add(volatile switch_atomic_t *mem, uint32_t val)
|
||||
{
|
||||
#ifdef apr_atomic_t
|
||||
apr_atomic_add((apr_atomic_t *)mem, val);
|
||||
#else
|
||||
apr_atomic_add32((apr_uint32_t *)mem, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_atomic_inc(volatile switch_atomic_t *mem)
|
||||
{
|
||||
#ifdef apr_atomic_t
|
||||
apr_atomic_inc((apr_atomic_t *)mem);
|
||||
#else
|
||||
apr_atomic_inc32((apr_uint32_t *)mem);
|
||||
#endif
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_atomic_dec(volatile switch_atomic_t *mem)
|
||||
{
|
||||
#ifdef apr_atomic_t
|
||||
return apr_atomic_dec((apr_atomic_t *)mem);
|
||||
#else
|
||||
return apr_atomic_dec32((apr_uint32_t *)mem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
|
||||
Reference in new issue
Block a user