class mt : public QThread {int i;public: int v() {return i;} void run();}void mt::run() { i=10000; while(i) i--;}
run () {while(!stopped){mutex.lock();l.append(file.readLine());mutex.unlock();}
QStringList getList() {QMutexLocker ml(&mutex);return l;}
void MessageReceiver::run() { mutex.lock(); if (!enabled) { mutex.unlock(); return; } stopped = false; mutex.unlock(); openSource(); if (!opened) return; while (!stopped) { QString s(getMessage()); mutex.lock(); m_MessageList.append(s); mutex.unlock(); msleep(1000); } closeSource();}