Im am refering to this statement from the QThread documentation page:
For example I want to tell the thread to do something while it's running. So I create a slot or a standard method and the slot sets a variable which the Qthread::run method reads and then does something. Do I have to use a mutex even if just one thread writes the variable and one only reads it?Like other objects, QThread objects live in the thread where the object was created -- not in the thread that is created when QThread::run() is called. It is generally unsafe to provide slots in your QThread subclass, unless you protect the member variables with a mutex.
Bookmarks