diff options
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qfuturewatcher.cpp | 2 | ||||
-rw-r--r-- | src/corelib/thread/qsemaphore.cpp | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 5 | ||||
-rw-r--r-- | src/corelib/thread/qwaitcondition_unix.cpp | 4 |
4 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp index faeb6b3a28..4ee7693ace 100644 --- a/src/corelib/thread/qfuturewatcher.cpp +++ b/src/corelib/thread/qfuturewatcher.cpp @@ -479,7 +479,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event) emit q->progressValueChanged(event->index1); if (!event->text.isNull()) // ### - q->progressTextChanged(event->text); + emit q->progressTextChanged(event->text); break; case QFutureCallOutEvent::ProgressRange: emit q->progressRangeChanged(event->index1, event->index2); diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp index aa04fb10ff..2e0b6f2bc0 100644 --- a/src/corelib/thread/qsemaphore.cpp +++ b/src/corelib/thread/qsemaphore.cpp @@ -606,7 +606,7 @@ bool QSemaphore::tryAcquire(int n, int timeout) \fn QSemaphoreReleaser::semaphore() const Returns a pointer to the QSemaphore object provided to the constructor, - or by the last move assignment, if any. Otherwise, returns \c nullptr. + or by the last move assignment, if any. Otherwise, returns \nullptr. */ /*! @@ -614,7 +614,7 @@ bool QSemaphore::tryAcquire(int n, int timeout) Cancels this QSemaphoreReleaser such that the destructor will no longer call \c{semaphore()->release()}. Returns the value of semaphore() - before this call. After this call, semaphore() will return \c nullptr. + before this call. After this call, semaphore() will return \nullptr. To enable again, assign a new QSemaphoreReleaser: diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 329caa02ba..a13f8ca215 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -100,6 +100,9 @@ #include <sys/neutrino.h> #endif +#if defined(Q_OS_WASM) +#include <emscripten/val.h> +#endif QT_BEGIN_NAMESPACE @@ -499,6 +502,8 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW // as of aug 2008 VxWorks < 6.6 only supports one single core CPU cores = 1; # endif +#elif defined(Q_OS_WASM) + cores = emscripten::val::global("navigator")["hardwareConcurrency"].as<int>(); #else // the rest: Linux, Solaris, AIX, Tru64 cores = (int)sysconf(_SC_NPROCESSORS_ONLN); diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index c93328b4bc..0ba90763cf 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -204,7 +204,7 @@ void QWaitCondition::wakeAll() bool QWaitCondition::wait(QMutex *mutex, unsigned long time) { - if (quint64(time) > quint64(std::numeric_limits<qint64>::max())) + if (time == std::numeric_limits<unsigned long>::max()) return wait(mutex, QDeadlineTimer(QDeadlineTimer::Forever)); return wait(mutex, QDeadlineTimer(time)); } @@ -231,6 +231,8 @@ bool QWaitCondition::wait(QMutex *mutex, QDeadlineTimer deadline) bool QWaitCondition::wait(QReadWriteLock *readWriteLock, unsigned long time) { + if (time == std::numeric_limits<unsigned long>::max()) + return wait(readWriteLock, QDeadlineTimer(QDeadlineTimer::Forever)); return wait(readWriteLock, QDeadlineTimer(time)); } |