Qt 4.8
Macros | Functions | Variables
qatomic_sh.h File Reference

Go to the source code of this file.

Macros

#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE
 
#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE
 
#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE
 
#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE
 
#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE
 
#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE
 
#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE
 

Functions

int qt_atomic_tasb (volatile char *ptr)
 
Q_CORE_EXPORT void qt_atomic_yield (int *count)
 

Variables

Q_CORE_EXPORT volatile char qt_atomic_lock
 

Macro Definition Documentation

◆ Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE

#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE

Definition at line 70 of file qatomic_sh.h.

◆ Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE

#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE

Definition at line 63 of file qatomic_sh.h.

◆ Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE

#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE

Definition at line 49 of file qatomic_sh.h.

◆ Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE

#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE

Definition at line 56 of file qatomic_sh.h.

◆ Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE

#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE

Definition at line 95 of file qatomic_sh.h.

◆ Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE

#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE

Definition at line 86 of file qatomic_sh.h.

◆ Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE

#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE

Definition at line 77 of file qatomic_sh.h.

Function Documentation

◆ qt_atomic_tasb()

int qt_atomic_tasb ( volatile char *  ptr)
inline

Definition at line 107 of file qatomic_sh.h.

108 {
109  register int ret;
110  asm volatile("tas.b @%2\n"
111  "movt %0"
112  : "=&r"(ret), "=m"(*ptr)
113  : "r"(ptr)
114  : "cc", "memory");
115  return ret;
116 }
const T * ptr(const T &t)

◆ qt_atomic_yield()

Q_CORE_EXPORT void qt_atomic_yield ( int *  count)

Definition at line 56 of file qatomic_arm.cpp.

Referenced by qt_atomic_tasb().

57 {
58 #ifdef _POSIX_PRIORITY_SCHEDULING
59  if((*count)++ < 50) {
60  sched_yield();
61  } else
62 #endif
63  {
64  struct timespec tm;
65  tm.tv_sec = 0;
66  tm.tv_nsec = 2000001;
67  nanosleep(&tm, NULL);
68  *count = 0;
69  }
70 }

Variable Documentation

◆ qt_atomic_lock

Q_CORE_EXPORT volatile char qt_atomic_lock

Definition at line 54 of file qatomic_sh.cpp.

Referenced by qt_atomic_tasb().