summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qwaitcondition_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qwaitcondition_unix.cpp')
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index b531707dd2..19c816475e 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -114,6 +114,10 @@ public:
int wait_relative(unsigned long time)
{
+ // TODO Emscripten specialization could perhaps be replaced with pthread stubs
+#if defined(Q_OS_NACL_EMSCRIPTEN) && !defined(Q_OS_NACL_EMSCRIPTEN_PTHREADS)
+ return 0;
+#endif
timespec ti;
#ifdef Q_OS_ANDROID
if (local_cond_timedwait_relative) {
@@ -128,6 +132,10 @@ public:
bool wait(unsigned long time)
{
+ // TODO Emscripten specialization could perhaps be replaced with pthread stubs
+#if defined(Q_OS_NACL_EMSCRIPTEN) && !defined(Q_OS_NACL_EMSCRIPTEN_PTHREADS)
+ return true;
+#endif
int code;
forever {
if (time != ULONG_MAX) {
@@ -194,6 +202,11 @@ void QWaitCondition::wakeAll()
bool QWaitCondition::wait(QMutex *mutex, unsigned long time)
{
+ // TODO Emscripten specialization could perhaps be replaced with pthread stubs
+#if defined(Q_OS_NACL_EMSCRIPTEN) && !defined(Q_OS_NACL_EMSCRIPTEN_PTHREADS)
+ return true;
+#endif
+
if (! mutex)
return false;
if (mutex->isRecursive()) {
@@ -214,6 +227,10 @@ bool QWaitCondition::wait(QMutex *mutex, unsigned long time)
bool QWaitCondition::wait(QReadWriteLock *readWriteLock, unsigned long time)
{
+ // TODO Emscripten specialization could perhaps be replaced with pthread stubs
+#if defined(Q_OS_NACL_EMSCRIPTEN) && !defined(Q_OS_NACL_EMSCRIPTEN_PTHREADS)
+ return true;
+#endif
if (!readWriteLock || readWriteLock->d->accessCount == 0)
return false;
if (readWriteLock->d->accessCount < -1) {