Move libcds 1.6.0 from SVN
[libcds.git] / cds / compiler / vc / x86 / backoff.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_COMPILER_VC_X86_BACKOFF_H
4 #define __CDS_COMPILER_VC_X86_BACKOFF_H
5
6 //@cond none
7
8 namespace cds { namespace backoff {
9     namespace vc { namespace x86 {
10
11 #       define CDS_backoff_pause_defined
12         static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
13         {
14             __asm {
15                 and ecx, nLoop;
16                 cmovz ecx, nLoop;
17                 rep nop;
18             }
19         }
20
21 #       define CDS_backoff_nop_defined
22         static inline void backoff_nop()
23         {
24             __nop();
25         }
26
27     }} // namespace vc::x86
28
29     namespace platform {
30         using namespace vc::x86;
31     }
32 }}  // namespace cds::backoff
33
34 //@endcond
35 #endif  // #ifndef __CDS_COMPILER_VC_X86_BACKOFF_H