diff options
Diffstat (limited to 'sandbox/multithreading-tests/wait-for-subscription-only-in-thread')
4 files changed, 0 insertions, 91 deletions
diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore deleted file mode 100644 index 4390dc85..00000000 --- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore +++ /dev/null @@ -1 +0,0 @@ -run-test diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am deleted file mode 100644 index 59dc63a7..00000000 --- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -noinst_PROGRAMS = run-test -run_test_SOURCES = main.cpp thread.h - -AM_CXXFLAGS = $(QtCore_CFLAGS) -LIBS += $(QtCore_LIBS) - -# library dependency hack for seamless make in cli/ -AM_CXXFLAGS += -I$(srcdir)/../../src -run_test_LDADD = ../../src/libcontextsubscriber.la - -../../src/libcontextsubscriber.la: FORCE - $(MAKE) -C ../../src libcontextsubscriber.la -.PHONY: FORCE - -# moccing -nodist_run_test_SOURCES = mocs.cpp -QT_TOMOC = $(filter %.h, $(run_test_SOURCES)) -include $(top_srcdir)/am/qt.am diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp deleted file mode 100644 index 1a1727b7..00000000 --- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include <contextproperty.h> - -#include "thread.h" - -#include <QCoreApplication> -#include <QThread> - -int main(int argc, char** argv) -{ - QCoreApplication app(argc, argv); - - qDebug() << "MAIN THREAD:" << QCoreApplication::instance()->thread(); - - // Start a thread which will create the ContextProperty. - Thread thread; - thread.start(); - - qDebug() << "Entering main loop"; - return app.exec(); -} diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h deleted file mode 100644 index e92af6f2..00000000 --- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef THREAD_H -#define THREAD_H - -#include <contextproperty.h> - -#include <QThread> -#include <QDebug> - -class Listener : public QObject -{ - Q_OBJECT - -public: - Listener() - { - cp = new ContextProperty("test.int"); - connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged())); - qDebug() << "**** Starting to wait"; - cp->waitForSubscription(); - qDebug() << "**** Waiting is done"; - qDebug() << "After waiting, the value is" << cp->value(); - sleep(1); - qDebug() << "After waiting 1 s more, the value is" << cp->value(); - - } - - ContextProperty* cp; - -public slots: - void onValueChanged() - { - qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread(); - qDebug() << "The value is:" << cp->value(); -// exit(1); - } -}; - -class Thread : public QThread -{ - Q_OBJECT - -protected: - void run() - { - qDebug() << "SUB THREAD:" << QThread::currentThread(); - Listener listener; - exec(); - } - -}; - -#endif |