Qt 4.8
Functions | Variables
qatomic_arm.cpp File Reference
#include <QtCore/qglobal.h>
#include <unistd.h>
#include <time.h>

Go to the source code of this file.

Functions

Q_CORE_EXPORT void qt_atomic_yield (int *count)
 

Variables

Q_CORE_EXPORT char q_atomic_lock = 0
 

Function Documentation

◆ qt_atomic_yield()

Q_CORE_EXPORT void qt_atomic_yield ( int *  count)

Definition at line 56 of file qatomic_arm.cpp.

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

◆ q_atomic_lock

Q_CORE_EXPORT char q_atomic_lock = 0

Definition at line 54 of file qatomic_arm.cpp.