[Kst] branches/work/kst/portto4/kst/src/libkst
Peter Kümmel
syntheticpp at gmx.net
Fri Aug 27 10:20:20 CEST 2010
SVN commit 1168709 by kuemmel:
at least compile on mac
M +4 -0 measuretime.cpp
M +2 -2 rwlock.cpp
--- branches/work/kst/portto4/kst/src/libkst/measuretime.cpp #1168708:1168709
@@ -66,10 +66,12 @@
QueryPerformanceCounter(&st);
started = st.QuadPart * frequency;
#else
+#ifndef Q_OS_MAC
timespec t;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
started = 1.0 * t.tv_sec + 1e-9 * t.tv_nsec;
#endif
+#endif
interval = 0;
}
@@ -81,10 +83,12 @@
QueryPerformanceCounter(&st);
double now = st.QuadPart * frequency;
#else
+#ifndef Q_OS_MAC
timespec t;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
double now = 1.0 * t.tv_sec + 1e-9 * t.tv_nsec;
#endif
+#endif
interval += now - started;
started = now;
}
--- branches/work/kst/portto4/kst/src/libkst/rwlock.cpp #1168708:1168709
@@ -90,7 +90,7 @@
QMap<Qt::HANDLE, int>::Iterator it = _readLockers.find(me);
if (it != _readLockers.end() && it.value() > 0) {
// cannot acquire a write lock if I already have a read lock -- ERROR
- qDebug() << "Thread " << (int)QThread::currentThreadId() << " tried to write lock KstRWLock " << (void*)this << " while holding a read lock" << endl;
+ qDebug() << "Thread " << QThread::currentThread() << " tried to write lock KstRWLock " << (void*)this << " while holding a read lock" << endl;
return;
}
}
@@ -126,7 +126,7 @@
QMap<Qt::HANDLE, int>::Iterator it = _readLockers.find(me);
if (it == _readLockers.end()) {
// read locked but not by me -- ERROR
- qDebug() << "Thread " << (int)QThread::currentThreadId() << " tried to unlock KstRWLock " << (void*)this << " (read locked) without holding the lock" << endl;
+ qDebug() << "Thread " << QThread::currentThread() << " tried to unlock KstRWLock " << (void*)this << " (read locked) without holding the lock" << endl;
return;
} else {
--_readCount;
More information about the Kst
mailing list