NCBI C++ ToolKit
Macros | Typedefs
ncbi_atomic_defs.h File Reference

(Highly!) platform-specific configuration for low-level atomic operations (reference-count manipulation, pointer swapping). More...

#include <ncbiconf.h>
#include <atomic>
#include <corelib/impl/ncbi_os_mswin.h>
+ Include dependency graph for ncbi_atomic_defs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_SCHED_YIELD()   ::SwitchToThread()
 
#define NCBI_SCHED_SPIN_INIT()   int spin_counter = 0
 
#define NCBI_SCHED_SPIN_YIELD()   if ( !(++spin_counter & 3) ) ::SwitchToThread()
 
#define NCBI_COUNTER_ASM_OK   1
 
#define NCBI_ATOMIC_TYPE(t)   std::atomic<t>
 
#define NCBI_COUNTER_UNSIGNED   1
 
#define NCBI_COUNTER_USE_STD_ATOMIC   1
 
#define NCBI_COUNTER_ADD(p, d)   ((*p) += d)
 
#define NCBI_SWAP_POINTERS(loc, nv)   (InterlockedExchangePointer(loc, nv))
 

Typedefs

typedef size_t TNCBIAtomicValue
 Define platform specific atomic-operations macros/values. More...
 

Detailed Description

(Highly!) platform-specific configuration for low-level atomic operations (reference-count manipulation, pointer swapping).

Definition in file ncbi_atomic_defs.h.

Modified on Tue Apr 23 07:36:50 2024 by modify_doxy.py rev. 669887