VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
vlc_atomic.h File Reference

Atomic operations do not require locking, but they are not very powerful. More...

Include dependency graph for vlc_atomic.h:

Go to the source code of this file.

Data Structures

union  vlc_atomic_t
 Memory storage space for an atom. More...

Macros

#define ATOMIC_FLAG_INIT   false
#define ATOMIC_VAR_INIT(value)   (value)
#define atomic_init(obj, value)   do { *(obj) = (value); } while(0)
#define kill_dependency(y)   ((void)0)
#define atomic_thread_fence(order)   __sync_synchronize()
#define atomic_signal_fence(order)   ((void)0)
#define atomic_is_lock_free(obj)   false
#define VLC_ATOMIC_INIT(val)   { (val) }
 Static initializer for vlc_atomic_t.

Typedefs

typedef bool atomic_flag
typedef bool atomic_bool
typedef char atomic_char
typedef signed char atomic_schar
typedef unsigned char atomic_uchar
typedef short atomic_short
typedef unsigned short atomic_ushort
typedef int atomic_int
typedef unsigned int atomic_uint
typedef long atomic_long
typedef unsigned long atomic_ulong
typedef long long atomic_llong
typedef unsigned long long atomic_ullong
typedef wchar_t atomic_wchar_t
typedef int_least8_t atomic_int_least8_t
typedef uint_least8_t atomic_uint_least8_t
typedef int_least16_t atomic_int_least16_t
typedef uint_least16_t atomic_uint_least16_t
typedef int_least32_t atomic_int_least32_t
typedef uint_least32_t atomic_uint_least32_t
typedef int_least64_t atomic_int_least64_t
typedef uint_least64_t atomic_uint_least64_t
typedef int_fast8_t atomic_int_fast8_t
typedef uint_fast8_t atomic_uint_fast8_t
typedef int_fast16_t atomic_int_fast16_t
typedef uint_fast16_t atomic_uint_fast16_t
typedef int_fast32_t atomic_int_fast32_t
typedef uint_fast32_t atomic_uint_fast32_t
typedef int_fast64_t atomic_int_fast64_t
typedef uint_fast64_t atomic_uint_fast64_t
typedef intptr_t atomic_intptr_t
typedef uintptr_t atomic_uintptr_t
typedef size_t atomic_size_t
typedef ptrdiff_t atomic_ptrdiff_t
typedef intmax_t atomic_intmax_t
typedef uintmax_t atomic_uintmax_t
typedef atomic_uint_least32_t vlc_atomic_float

Functions

static uintptr_t vlc_atomic_get (vlc_atomic_t *atom)
static uintptr_t vlc_atomic_set (vlc_atomic_t *atom, uintptr_t v)
static uintptr_t vlc_atomic_add (vlc_atomic_t *atom, uintptr_t v)
static uintptr_t vlc_atomic_sub (vlc_atomic_t *atom, uintptr_t v)
static uintptr_t vlc_atomic_inc (vlc_atomic_t *atom)
static uintptr_t vlc_atomic_dec (vlc_atomic_t *atom)
static uintptr_t vlc_atomic_swap (vlc_atomic_t *atom, uintptr_t v)
static uintptr_t vlc_atomic_compare_swap (vlc_atomic_t *atom, uintptr_t u, uintptr_t v)
static float vlc_atomic_loadf (vlc_atomic_float *atom)
 Helper to retrieve a single precision from an atom.
static void vlc_atomic_storef (vlc_atomic_float *atom, float f)
 Helper to store a single precision into an atom.

Detailed Description

Atomic operations do not require locking, but they are not very powerful.

Macro Definition Documentation

#define ATOMIC_FLAG_INIT   false
#define atomic_init (   obj,
  value 
)    do { *(obj) = (value); } while(0)
#define atomic_is_lock_free (   obj)    false
#define atomic_signal_fence (   order)    ((void)0)
#define atomic_thread_fence (   order)    __sync_synchronize()
#define ATOMIC_VAR_INIT (   value)    (value)

Referenced by input_item_NewWithType().

#define kill_dependency (   y)    ((void)0)
#define VLC_ATOMIC_INIT (   val)    { (val) }

Static initializer for vlc_atomic_t.

Typedef Documentation

typedef bool atomic_bool
typedef char atomic_char
typedef bool atomic_flag
typedef int atomic_int
typedef int_fast16_t atomic_int_fast16_t
typedef int_fast32_t atomic_int_fast32_t
typedef int_fast64_t atomic_int_fast64_t
typedef int_fast8_t atomic_int_fast8_t
typedef int_least16_t atomic_int_least16_t
typedef int_least32_t atomic_int_least32_t
typedef int_least64_t atomic_int_least64_t
typedef int_least8_t atomic_int_least8_t
typedef intmax_t atomic_intmax_t
typedef intptr_t atomic_intptr_t
typedef long long atomic_llong
typedef long atomic_long
typedef ptrdiff_t atomic_ptrdiff_t
typedef signed char atomic_schar
typedef short atomic_short
typedef size_t atomic_size_t
typedef unsigned char atomic_uchar
typedef unsigned int atomic_uint
typedef uint_fast16_t atomic_uint_fast16_t
typedef uint_fast32_t atomic_uint_fast32_t
typedef uint_fast64_t atomic_uint_fast64_t
typedef uint_fast8_t atomic_uint_fast8_t
typedef uint_least16_t atomic_uint_least16_t
typedef uint_least32_t atomic_uint_least32_t
typedef uint_least64_t atomic_uint_least64_t
typedef uint_least8_t atomic_uint_least8_t
typedef uintmax_t atomic_uintmax_t
typedef uintptr_t atomic_uintptr_t
typedef unsigned long long atomic_ullong
typedef unsigned long atomic_ulong
typedef unsigned short atomic_ushort
typedef wchar_t atomic_wchar_t

Function Documentation

static uintptr_t vlc_atomic_add ( vlc_atomic_t atom,
uintptr_t  v 
)
inlinestatic

References vlc_atomic_t::u.

Referenced by vlc_atomic_inc().

static uintptr_t vlc_atomic_compare_swap ( vlc_atomic_t atom,
uintptr_t  u,
uintptr_t  v 
)
inlinestatic

References vlc_atomic_t::u.

static uintptr_t vlc_atomic_dec ( vlc_atomic_t atom)
inlinestatic

References vlc_atomic_sub().

Referenced by picture_Release().

static uintptr_t vlc_atomic_get ( vlc_atomic_t atom)
inlinestatic
static uintptr_t vlc_atomic_inc ( vlc_atomic_t atom)
inlinestatic

References vlc_atomic_add().

Referenced by picture_Hold().

static float vlc_atomic_loadf ( vlc_atomic_float atom)
inlinestatic

Helper to retrieve a single precision from an atom.

Referenced by aout_volume_Amplify().

static uintptr_t vlc_atomic_set ( vlc_atomic_t atom,
uintptr_t  v 
)
inlinestatic
static void vlc_atomic_storef ( vlc_atomic_float atom,
float  f 
)
inlinestatic

Helper to store a single precision into an atom.

Referenced by ReplayGainCallback().

static uintptr_t vlc_atomic_sub ( vlc_atomic_t atom,
uintptr_t  v 
)
inlinestatic

References vlc_atomic_t::u.

Referenced by vlc_atomic_dec().

static uintptr_t vlc_atomic_swap ( vlc_atomic_t atom,
uintptr_t  v 
)
inlinestatic

References vlc_atomic_t::u.