ReactOS 0.4.15-dev-7834-g00c4b3d
_Atomic_swap_struct< 0 > Class Reference

#include <_threads.h>

Static Public Member Functions

static __stl_atomic_t _S_swap (_STLP_VOLATILE __stl_atomic_t *__p, __stl_atomic_t __q)
 
static void_S_swap_ptr (void *_STLP_VOLATILE *__p, void *__q)
 

Detailed Description

Definition at line 556 of file _threads.h.

Member Function Documentation

◆ _S_swap()

static __stl_atomic_t _Atomic_swap_struct< 0 >::_S_swap ( _STLP_VOLATILE __stl_atomic_t __p,
__stl_atomic_t  __q 
)
inlinestatic

Definition at line 566 of file _threads.h.

566 {
567#if defined (_STLP_THREADS)
568# if defined (_STLP_ATOMIC_EXCHANGE)
569 return _STLP_ATOMIC_EXCHANGE(__p, __q);
570# elif defined (_STLP_USE_ATOMIC_SWAP_MUTEX)
571 /* This should be portable, but performance is expected
572 * to be quite awful. This really needs platform specific
573 * code.
574 */
575 _S_swap_lock._M_acquire_lock();
576 __stl_atomic_t __result = *__p;
577 *__p = __q;
578 _S_swap_lock._M_release_lock();
579 return __result;
580# else
581# error Missing atomic swap implementation
582# endif
583#else
584 /* no threads */
585 __stl_atomic_t __result = *__p;
586 *__p = __q;
587 return __result;
588#endif // _STLP_THREADS
589 }
#define _STLP_ATOMIC_EXCHANGE(__x, __y)
Definition: _sparc_atomic.h:59
size_t __stl_atomic_t
Definition: _threads.h:232

◆ _S_swap_ptr()

static void * _Atomic_swap_struct< 0 >::_S_swap_ptr ( void *_STLP_VOLATILE __p,
void __q 
)
inlinestatic

Definition at line 591 of file _threads.h.

591 {
592#if defined (_STLP_THREADS)
593# if defined (_STLP_ATOMIC_EXCHANGE_PTR)
594 return _STLP_ATOMIC_EXCHANGE_PTR(__p, __q);
595# elif defined (_STLP_ATOMIC_EXCHANGE)
596 _STLP_STATIC_ASSERT(sizeof(__stl_atomic_t) == sizeof(void*))
599 );
600# elif defined (_STLP_USE_ATOMIC_SWAP_MUTEX)
601 _S_swap_lock._M_acquire_lock();
602 void *__result = *__p;
603 *__p = __q;
604 _S_swap_lock._M_release_lock();
605 return __result;
606# else
607# error Missing pointer atomic swap implementation
608# endif
609#else
610 /* no thread */
611 void *__result = *__p;
612 *__p = __q;
613 return __result;
614#endif
615 }
#define __REINTERPRET_CAST(__x, __y)
Definition: features.h:586
#define _STLP_STATIC_ASSERT(expr)
Definition: features.h:313

The documentation for this class was generated from the following file: