RTS API Documentation  1.10.11
Typedefs | Functions
Multi-Threaded Adtomic Operations Routines
+ Collaboration diagram for Multi-Threaded Adtomic Operations Routines:

Typedefs

typedef uint32_t switch_atomic_t
 

Functions

switch_status_t switch_atomic_init (switch_memory_pool_t *pool)
 
uint32_t switch_atomic_read (volatile switch_atomic_t *mem)
 
void switch_atomic_set (volatile switch_atomic_t *mem, uint32_t val)
 
void switch_atomic_add (volatile switch_atomic_t *mem, uint32_t val)
 
void switch_atomic_inc (volatile switch_atomic_t *mem)
 
int switch_atomic_dec (volatile switch_atomic_t *mem)
 

Detailed Description

Typedef Documentation

◆ switch_atomic_t

typedef uint32_t switch_atomic_t

Opaque type used for the atomic operations

Definition at line 380 of file switch_apr.h.

Function Documentation

◆ switch_atomic_add()

void switch_atomic_add ( volatile switch_atomic_t mem,
uint32_t  val 
)

Uses an atomic operation to add the uint32 value to the value at the specified location of memory.

Parameters
memThe location of the value to add to.
valThe uint32 value to add to the value at the memory location.

Definition at line 1413 of file switch_apr.c.

1414 {
1415 #ifdef fspr_atomic_t
1416  fspr_atomic_add((fspr_atomic_t *)mem, val);
1417 #else
1418  fspr_atomic_add32((fspr_uint32_t *)mem, val);
1419 #endif
1420 }

◆ switch_atomic_dec()

int switch_atomic_dec ( volatile switch_atomic_t mem)

Uses an atomic operation to decrement the value at the specified memroy location.

Parameters
memThe location of the value to decrement.

Definition at line 1431 of file switch_apr.c.

1432 {
1433 #ifdef fspr_atomic_t
1434  return fspr_atomic_dec((fspr_atomic_t *)mem);
1435 #else
1436  return fspr_atomic_dec32((fspr_uint32_t *)mem);
1437 #endif
1438 }

◆ switch_atomic_inc()

void switch_atomic_inc ( volatile switch_atomic_t mem)

Uses an atomic operation to increment the value at the specified memroy location.

Parameters
memThe location of the value to increment.

Definition at line 1422 of file switch_apr.c.

1423 {
1424 #ifdef fspr_atomic_t
1425  fspr_atomic_inc((fspr_atomic_t *)mem);
1426 #else
1427  fspr_atomic_inc32((fspr_uint32_t *)mem);
1428 #endif
1429 }

◆ switch_atomic_init()

switch_status_t switch_atomic_init ( switch_memory_pool_t pool)

Some architectures require atomic operations internal structures to be initialized before use.

Parameters
poolThe memory pool to use when initializing the structures.

Definition at line 1390 of file switch_apr.c.

1391 {
1392  return fspr_atomic_init((fspr_pool_t *) pool);
1393 }
switch_memory_pool_t * pool

◆ switch_atomic_read()

uint32_t switch_atomic_read ( volatile switch_atomic_t mem)

Uses an atomic operation to read the uint32 value at the location specified by mem.

Parameters
memThe location of memory which stores the value to read.

Definition at line 1395 of file switch_apr.c.

Referenced by switch_xml_config_parse_event().

1396 {
1397 #ifdef fspr_atomic_t
1398  return fspr_atomic_read((fspr_atomic_t *)mem);
1399 #else
1400  return fspr_atomic_read32((fspr_uint32_t *)mem);
1401 #endif
1402 }

◆ switch_atomic_set()

void switch_atomic_set ( volatile switch_atomic_t mem,
uint32_t  val 
)

Uses an atomic operation to set a uint32 value at a specified location of memory.

Parameters
memThe location of memory to set.
valThe uint32 value to set at the memory location.

Definition at line 1404 of file switch_apr.c.

Referenced by switch_xml_config_parse_event().

1405 {
1406 #ifdef fspr_atomic_t
1407  fspr_atomic_set((fspr_atomic_t *)mem, val);
1408 #else
1409  fspr_atomic_set32((fspr_uint32_t *)mem, val);
1410 #endif
1411 }