ReactOS 0.4.15-dev-7842-g558ab78
_Atomic_swap_struct< __use_ptr_atomic_swap > Class Template 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

template<int __use_ptr_atomic_swap>
class _Atomic_swap_struct< __use_ptr_atomic_swap >

Definition at line 497 of file _threads.h.

Member Function Documentation

◆ _S_swap()

template<int __use_ptr_atomic_swap>
static __stl_atomic_t _Atomic_swap_struct< __use_ptr_atomic_swap >::_S_swap ( _STLP_VOLATILE __stl_atomic_t __p,
__stl_atomic_t  __q 
)
inlinestatic

Definition at line 507 of file _threads.h.

507 {
508#if defined (_STLP_THREADS)
509# if defined (_STLP_ATOMIC_EXCHANGE)
510 return _STLP_ATOMIC_EXCHANGE(__p, __q);
511# elif defined (_STLP_USE_ATOMIC_SWAP_MUTEX)
512 _S_swap_lock._M_acquire_lock();
513 __stl_atomic_t __result = *__p;
514 *__p = __q;
515 _S_swap_lock._M_release_lock();
516 return __result;
517# else
518# error Missing atomic swap implementation
519# endif
520#else
521 /* no threads */
522 __stl_atomic_t __result = *__p;
523 *__p = __q;
524 return __result;
525#endif // _STLP_THREADS
526 }
#define _STLP_ATOMIC_EXCHANGE(__x, __y)
Definition: _sparc_atomic.h:59
size_t __stl_atomic_t
Definition: _threads.h:232

Referenced by _Atomic_swap().

◆ _S_swap_ptr()

template<int __use_ptr_atomic_swap>
static void * _Atomic_swap_struct< __use_ptr_atomic_swap >::_S_swap_ptr ( void *_STLP_VOLATILE __p,
void __q 
)
inlinestatic

Definition at line 528 of file _threads.h.

528 {
529#if defined (_STLP_THREADS)
530# if defined (_STLP_ATOMIC_EXCHANGE_PTR)
531 return _STLP_ATOMIC_EXCHANGE_PTR(__p, __q);
532# elif defined (_STLP_ATOMIC_EXCHANGE)
533 _STLP_STATIC_ASSERT(sizeof(__stl_atomic_t) == sizeof(void*))
536 );
537# elif defined (_STLP_USE_ATOMIC_SWAP_MUTEX)
538 _S_swap_lock._M_acquire_lock();
539 void *__result = *__p;
540 *__p = __q;
541 _S_swap_lock._M_release_lock();
542 return __result;
543# else
544# error Missing pointer atomic swap implementation
545# endif
546#else
547 /* no thread */
548 void *__result = *__p;
549 *__p = __q;
550 return __result;
551#endif
552 }
#define __REINTERPRET_CAST(__x, __y)
Definition: features.h:586
#define _STLP_STATIC_ASSERT(expr)
Definition: features.h:313

Referenced by _Atomic_swap_ptr().


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