Still this gives almost nothing.
At least it seems you did something wrong.
Emitting and reciving in slot a pointer value is disturbing solution especially in mutithreding case.
I also suspect that you are using lock in wrong way.
The safest way to solve mutithreading producer consumer problem in Qt is:
Define QObjects class representing producer and consumer (do NOT subclass QThread!!!).
Create needed QThreads and move instances of producer (QObject::moveToThread) and consumer to proper threads.
Connect signal of producer to respective slot of consumer.
To pass by value custom structure by a signal slot mechanism declare and define meta data for this custom type (instruction can be found in documentation).
Use of default Qt type is recommended (QList, QVector insted std::list and std:vector).
Note that consumer should be faster then producer or event queue of consumer may grow.




Reply With Quote
Bookmarks