Blender V4.3
atomic_ops.h File Reference

Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operations over float numbers). More...

Go to the source code of this file.

Functions

ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64 (uint64_t *p, uint64_t x)
 
ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64 (uint64_t *p, uint64_t x)
 
ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64 (uint64_t *p, uint64_t x)
 
ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64 (uint64_t *p, uint64_t x)
 
ATOMIC_INLINE uint64_t atomic_cas_uint64 (uint64_t *v, uint64_t old, uint64_t _new)
 
ATOMIC_INLINE uint64_t atomic_load_uint64 (const uint64_t *v)
 
ATOMIC_INLINE void atomic_store_uint64 (uint64_t *p, uint64_t v)
 
ATOMIC_INLINE int64_t atomic_add_and_fetch_int64 (int64_t *p, int64_t x)
 
ATOMIC_INLINE int64_t atomic_sub_and_fetch_int64 (int64_t *p, int64_t x)
 
ATOMIC_INLINE int64_t atomic_fetch_and_add_int64 (int64_t *p, int64_t x)
 
ATOMIC_INLINE int64_t atomic_fetch_and_sub_int64 (int64_t *p, int64_t x)
 
ATOMIC_INLINE int64_t atomic_cas_int64 (int64_t *v, int64_t old, int64_t _new)
 
ATOMIC_INLINE int64_t atomic_load_int64 (const int64_t *v)
 
ATOMIC_INLINE void atomic_store_int64 (int64_t *p, int64_t v)
 
ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32 (uint32_t *p, uint32_t x)
 
ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32 (uint32_t *p, uint32_t x)
 
ATOMIC_INLINE uint32_t atomic_cas_uint32 (uint32_t *v, uint32_t old, uint32_t _new)
 
ATOMIC_INLINE uint32_t atomic_load_uint32 (const uint32_t *v)
 
ATOMIC_INLINE void atomic_store_uint32 (uint32_t *p, uint32_t v)
 
ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32 (uint32_t *p, uint32_t x)
 
ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32 (uint32_t *p, uint32_t x)
 
ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32 (uint32_t *p, uint32_t x)
 
ATOMIC_INLINE int32_t atomic_add_and_fetch_int32 (int32_t *p, int32_t x)
 
ATOMIC_INLINE int32_t atomic_sub_and_fetch_int32 (int32_t *p, int32_t x)
 
ATOMIC_INLINE int32_t atomic_cas_int32 (int32_t *v, int32_t old, int32_t _new)
 
ATOMIC_INLINE int32_t atomic_load_int32 (const int32_t *v)
 
ATOMIC_INLINE void atomic_store_int32 (int32_t *p, int32_t v)
 
ATOMIC_INLINE int32_t atomic_fetch_and_add_int32 (int32_t *p, int32_t x)
 
ATOMIC_INLINE int32_t atomic_fetch_and_or_int32 (int32_t *p, int32_t x)
 
ATOMIC_INLINE int32_t atomic_fetch_and_and_int32 (int32_t *p, int32_t x)
 
ATOMIC_INLINE int16_t atomic_fetch_and_or_int16 (int16_t *p, int16_t b)
 
ATOMIC_INLINE int16_t atomic_fetch_and_and_int16 (int16_t *p, int16_t b)
 
ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8 (uint8_t *p, uint8_t b)
 
ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8 (uint8_t *p, uint8_t b)
 
ATOMIC_INLINE int8_t atomic_fetch_and_or_int8 (int8_t *p, int8_t b)
 
ATOMIC_INLINE int8_t atomic_fetch_and_and_int8 (int8_t *p, int8_t b)
 
ATOMIC_INLINE char atomic_fetch_and_or_char (char *p, char b)
 
ATOMIC_INLINE char atomic_fetch_and_and_char (char *p, char b)
 
ATOMIC_INLINE size_t atomic_add_and_fetch_z (size_t *p, size_t x)
 
ATOMIC_INLINE size_t atomic_sub_and_fetch_z (size_t *p, size_t x)
 
ATOMIC_INLINE size_t atomic_fetch_and_add_z (size_t *p, size_t x)
 
ATOMIC_INLINE size_t atomic_fetch_and_sub_z (size_t *p, size_t x)
 
ATOMIC_INLINE size_t atomic_cas_z (size_t *v, size_t old, size_t _new)
 
ATOMIC_INLINE size_t atomic_load_z (const size_t *v)
 
ATOMIC_INLINE void atomic_store_z (size_t *p, size_t v)
 
ATOMIC_INLINE size_t atomic_fetch_and_update_max_z (size_t *p, size_t x)
 
ATOMIC_INLINE unsigned int atomic_add_and_fetch_u (unsigned int *p, unsigned int x)
 
ATOMIC_INLINE unsigned int atomic_sub_and_fetch_u (unsigned int *p, unsigned int x)
 
ATOMIC_INLINE unsigned int atomic_fetch_and_add_u (unsigned int *p, unsigned int x)
 
ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u (unsigned int *p, unsigned int x)
 
ATOMIC_INLINE unsigned int atomic_cas_u (unsigned int *v, unsigned int old, unsigned int _new)
 
ATOMIC_INLINE void * atomic_cas_ptr (void **v, void *old, void *_new)
 
ATOMIC_INLINE void * atomic_load_ptr (void *const *v)
 
ATOMIC_INLINE void atomic_store_ptr (void **p, void *v)
 
ATOMIC_INLINE float atomic_cas_float (float *v, float old, float _new)
 
ATOMIC_INLINE float atomic_add_and_fetch_fl (float *p, const float x)
 

Detailed Description

Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operations over float numbers).

Definition in file atomic_ops.h.

Function Documentation

◆ atomic_add_and_fetch_fl()

ATOMIC_INLINE float atomic_add_and_fetch_fl ( float * p,
const float x )

Definition at line 234 of file atomic_ops_ext.h.

References _ATOMIC_UNLIKELY, atomic_cas_uint32(), and x.

Referenced by TEST().

◆ atomic_add_and_fetch_int32()

ATOMIC_INLINE int32_t atomic_add_and_fetch_int32 ( int32_t * p,
int32_t x )

Definition at line 179 of file atomic_ops_msvc.h.

References x.

Referenced by blender::nodes::node_geo_scale_elements_cc::from_indices_large_groups(), and TEST().

◆ atomic_add_and_fetch_int64()

ATOMIC_INLINE int64_t atomic_add_and_fetch_int64 ( int64_t * p,
int64_t x )

Definition at line 100 of file atomic_ops_msvc.h.

References x.

Referenced by TEST().

◆ atomic_add_and_fetch_u()

ATOMIC_INLINE unsigned int atomic_add_and_fetch_u ( unsigned int * p,
unsigned int x )

◆ atomic_add_and_fetch_uint32()

◆ atomic_add_and_fetch_uint64()

◆ atomic_add_and_fetch_z()

ATOMIC_INLINE size_t atomic_add_and_fetch_z ( size_t * p,
size_t x )

◆ atomic_cas_float()

ATOMIC_INLINE float atomic_cas_float ( float * v,
float old,
float _new )

Definition at line 228 of file atomic_ops_ext.h.

References atomic_cas_uint32(), ret, and v.

Referenced by TEST().

◆ atomic_cas_int32()

ATOMIC_INLINE int32_t atomic_cas_int32 ( int32_t * v,
int32_t old,
int32_t _new )

Definition at line 189 of file atomic_ops_msvc.h.

References v.

Referenced by TEST().

◆ atomic_cas_int64()

ATOMIC_INLINE int64_t atomic_cas_int64 ( int64_t * v,
int64_t old,
int64_t _new )

Definition at line 110 of file atomic_ops_msvc.h.

References v.

Referenced by TEST().

◆ atomic_cas_ptr()

ATOMIC_INLINE void * atomic_cas_ptr ( void ** v,
void * old,
void * _new )

◆ atomic_cas_u()

ATOMIC_INLINE unsigned int atomic_cas_u ( unsigned int * v,
unsigned int old,
unsigned int _new )

Definition at line 173 of file atomic_ops_ext.h.

References atomic_cas_uint32(), atomic_cas_uint64(), and v.

Referenced by TEST().

◆ atomic_cas_uint32()

ATOMIC_INLINE uint32_t atomic_cas_uint32 ( uint32_t * v,
uint32_t old,
uint32_t _new )

◆ atomic_cas_uint64()

ATOMIC_INLINE uint64_t atomic_cas_uint64 ( uint64_t * v,
uint64_t old,
uint64_t _new )

Definition at line 74 of file atomic_ops_msvc.h.

References v.

Referenced by atomic_cas_ptr(), atomic_cas_u(), atomic_cas_z(), and TEST().

◆ atomic_cas_z()

ATOMIC_INLINE size_t atomic_cas_z ( size_t * v,
size_t old,
size_t _new )

Definition at line 94 of file atomic_ops_ext.h.

References atomic_cas_uint32(), atomic_cas_uint64(), and v.

Referenced by atomic_fetch_and_update_max_z(), and TEST().

◆ atomic_fetch_and_add_int32()

◆ atomic_fetch_and_add_int64()

ATOMIC_INLINE int64_t atomic_fetch_and_add_int64 ( int64_t * p,
int64_t x )

Definition at line 125 of file atomic_ops_msvc.h.

Referenced by TEST().

◆ atomic_fetch_and_add_u()

ATOMIC_INLINE unsigned int atomic_fetch_and_add_u ( unsigned int * p,
unsigned int x )

Definition at line 155 of file atomic_ops_ext.h.

References atomic_fetch_and_add_uint32(), and atomic_fetch_and_add_uint64().

Referenced by BLI_threadpool_init(), and TEST().

◆ atomic_fetch_and_add_uint32()

◆ atomic_fetch_and_add_uint64()

◆ atomic_fetch_and_add_z()

ATOMIC_INLINE size_t atomic_fetch_and_add_z ( size_t * p,
size_t x )

Definition at line 76 of file atomic_ops_ext.h.

References atomic_fetch_and_add_uint32(), and atomic_fetch_and_add_uint64().

Referenced by TEST().

◆ atomic_fetch_and_and_char()

ATOMIC_INLINE char atomic_fetch_and_and_char ( char * p,
char b )

Definition at line 189 of file atomic_ops_ext.h.

References atomic_fetch_and_and_uint8(), and b.

Referenced by TEST().

◆ atomic_fetch_and_and_int16()

ATOMIC_INLINE int16_t atomic_fetch_and_and_int16 ( int16_t * p,
int16_t b )

Definition at line 228 of file atomic_ops_msvc.h.

Referenced by BKE_previewimg_finish(), and TEST().

◆ atomic_fetch_and_and_int32()

ATOMIC_INLINE int32_t atomic_fetch_and_and_int32 ( int32_t * p,
int32_t x )

Definition at line 214 of file atomic_ops_msvc.h.

Referenced by BKE_id_tag_clear_atomic(), and TEST().

◆ atomic_fetch_and_and_int8()

ATOMIC_INLINE int8_t atomic_fetch_and_and_int8 ( int8_t * p,
int8_t b )

Definition at line 259 of file atomic_ops_msvc.h.

References b.

Referenced by TEST().

◆ atomic_fetch_and_and_uint32()

ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32 ( uint32_t * p,
uint32_t x )

Definition at line 173 of file atomic_ops_msvc.h.

Referenced by TEST().

◆ atomic_fetch_and_and_uint8()

ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8 ( uint8_t * p,
uint8_t b )

Definition at line 238 of file atomic_ops_msvc.h.

References b.

Referenced by atomic_fetch_and_and_char(), dynamic_paint_effect_drip_cb(), and TEST().

◆ atomic_fetch_and_or_char()

ATOMIC_INLINE char atomic_fetch_and_or_char ( char * p,
char b )

Definition at line 184 of file atomic_ops_ext.h.

References atomic_fetch_and_or_uint8(), and b.

Referenced by TEST().

◆ atomic_fetch_and_or_int16()

ATOMIC_INLINE int16_t atomic_fetch_and_or_int16 ( int16_t * p,
int16_t b )

Definition at line 223 of file atomic_ops_msvc.h.

Referenced by TEST().

◆ atomic_fetch_and_or_int32()

ATOMIC_INLINE int32_t atomic_fetch_and_or_int32 ( int32_t * p,
int32_t x )

Definition at line 209 of file atomic_ops_msvc.h.

Referenced by BKE_id_tag_set_atomic(), and TEST().

◆ atomic_fetch_and_or_int8()

ATOMIC_INLINE int8_t atomic_fetch_and_or_int8 ( int8_t * p,
int8_t b )

Definition at line 269 of file atomic_ops_msvc.h.

References b.

Referenced by TEST().

◆ atomic_fetch_and_or_uint32()

◆ atomic_fetch_and_or_uint8()

ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8 ( uint8_t * p,
uint8_t b )

Definition at line 248 of file atomic_ops_msvc.h.

References b.

Referenced by atomic_fetch_and_or_char(), dynamic_paint_effect_drip_cb(), and TEST().

◆ atomic_fetch_and_sub_int64()

ATOMIC_INLINE int64_t atomic_fetch_and_sub_int64 ( int64_t * p,
int64_t x )

Definition at line 130 of file atomic_ops_msvc.h.

Referenced by TEST().

◆ atomic_fetch_and_sub_u()

ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u ( unsigned int * p,
unsigned int x )

Definition at line 164 of file atomic_ops_ext.h.

References atomic_fetch_and_add_uint32(), and atomic_fetch_and_add_uint64().

Referenced by TEST().

◆ atomic_fetch_and_sub_uint64()

ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64 ( uint64_t * p,
uint64_t x )

Definition at line 94 of file atomic_ops_msvc.h.

Referenced by TEST().

◆ atomic_fetch_and_sub_z()

ATOMIC_INLINE size_t atomic_fetch_and_sub_z ( size_t * p,
size_t x )

Definition at line 85 of file atomic_ops_ext.h.

References atomic_fetch_and_add_uint32(), and atomic_fetch_and_add_uint64().

Referenced by TEST().

◆ atomic_fetch_and_update_max_z()

ATOMIC_INLINE size_t atomic_fetch_and_update_max_z ( size_t * p,
size_t x )

Definition at line 121 of file atomic_ops_ext.h.

References atomic_cas_z().

Referenced by Stats::mem_alloc(), and TEST().

◆ atomic_load_int32()

ATOMIC_INLINE int32_t atomic_load_int32 ( const int32_t * v)

Definition at line 194 of file atomic_ops_msvc.h.

References __atomic_impl_load_generic, and v.

Referenced by TEST().

◆ atomic_load_int64()

ATOMIC_INLINE int64_t atomic_load_int64 ( const int64_t * v)

Definition at line 115 of file atomic_ops_msvc.h.

References __atomic_impl_load_generic, and v.

Referenced by TEST().

◆ atomic_load_ptr()

ATOMIC_INLINE void * atomic_load_ptr ( void *const * v)

Definition at line 206 of file atomic_ops_ext.h.

References atomic_load_uint32(), atomic_load_uint64(), and v.

Referenced by TEST().

◆ atomic_load_uint32()

ATOMIC_INLINE uint32_t atomic_load_uint32 ( const uint32_t * v)

Definition at line 153 of file atomic_ops_msvc.h.

References __atomic_impl_load_generic, and v.

Referenced by atomic_load_ptr(), atomic_load_z(), and TEST().

◆ atomic_load_uint64()

ATOMIC_INLINE uint64_t atomic_load_uint64 ( const uint64_t * v)

Definition at line 79 of file atomic_ops_msvc.h.

References __atomic_impl_load_generic, and v.

Referenced by atomic_load_ptr(), atomic_load_z(), and TEST().

◆ atomic_load_z()

ATOMIC_INLINE size_t atomic_load_z ( const size_t * v)

Definition at line 103 of file atomic_ops_ext.h.

References atomic_load_uint32(), atomic_load_uint64(), and v.

Referenced by TEST().

◆ atomic_store_int32()

ATOMIC_INLINE void atomic_store_int32 ( int32_t * p,
int32_t v )

Definition at line 199 of file atomic_ops_msvc.h.

References __atomic_impl_store_generic, and v.

Referenced by TEST().

◆ atomic_store_int64()

ATOMIC_INLINE void atomic_store_int64 ( int64_t * p,
int64_t v )

Definition at line 120 of file atomic_ops_msvc.h.

References __atomic_impl_store_generic, and v.

Referenced by TEST().

◆ atomic_store_ptr()

ATOMIC_INLINE void atomic_store_ptr ( void ** p,
void * v )

Definition at line 215 of file atomic_ops_ext.h.

References atomic_store_uint32(), atomic_store_uint64(), and v.

Referenced by TEST().

◆ atomic_store_uint32()

ATOMIC_INLINE void atomic_store_uint32 ( uint32_t * p,
uint32_t v )

Definition at line 158 of file atomic_ops_msvc.h.

References __atomic_impl_store_generic, and v.

Referenced by atomic_store_ptr(), atomic_store_z(), and TEST().

◆ atomic_store_uint64()

ATOMIC_INLINE void atomic_store_uint64 ( uint64_t * p,
uint64_t v )

Definition at line 84 of file atomic_ops_msvc.h.

References __atomic_impl_store_generic, and v.

Referenced by atomic_store_ptr(), atomic_store_z(), and TEST().

◆ atomic_store_z()

ATOMIC_INLINE void atomic_store_z ( size_t * p,
size_t v )

Definition at line 112 of file atomic_ops_ext.h.

References atomic_store_uint32(), atomic_store_uint64(), and v.

Referenced by TEST().

◆ atomic_sub_and_fetch_int32()

ATOMIC_INLINE int32_t atomic_sub_and_fetch_int32 ( int32_t * p,
int32_t x )

Definition at line 184 of file atomic_ops_msvc.h.

References x.

Referenced by TEST().

◆ atomic_sub_and_fetch_int64()

ATOMIC_INLINE int64_t atomic_sub_and_fetch_int64 ( int64_t * p,
int64_t x )

Definition at line 105 of file atomic_ops_msvc.h.

References x.

Referenced by TEST().

◆ atomic_sub_and_fetch_u()

ATOMIC_INLINE unsigned int atomic_sub_and_fetch_u ( unsigned int * p,
unsigned int x )

Definition at line 146 of file atomic_ops_ext.h.

References atomic_add_and_fetch_uint32(), and atomic_add_and_fetch_uint64().

Referenced by rem_memblock(), and TEST().

◆ atomic_sub_and_fetch_uint32()

ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32 ( uint32_t * p,
uint32_t x )

Definition at line 143 of file atomic_ops_msvc.h.

References x.

Referenced by GPU_material_free_single(), task_mempool_iter_func(), and TEST().

◆ atomic_sub_and_fetch_uint64()

ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64 ( uint64_t * p,
uint64_t x )

Definition at line 69 of file atomic_ops_msvc.h.

References x.

Referenced by TEST().

◆ atomic_sub_and_fetch_z()

ATOMIC_INLINE size_t atomic_sub_and_fetch_z ( size_t * p,
size_t x )