I'm trying to acquire data which is stored in a buffer. The instance of the buffer is private to my producer thread. How will I be able to access this data in my consumer thread?
This is the producer thread header.
#ifndef COMPUTINGTHREAD_H
#define COMPUTINGTHREAD_H
#include <QThread>
class ImageBuffer;
class ComputingThread
: public QThread{
public:
ComputingThread();
~ComputingThread();
void haltComputing();
void startTransmitting();
void stopTransmitting();
protected:
void run();
private:
volatile bool halt;
volatile bool transmit;
ImageBuffer* imageBuffer;
};
#endif
#ifndef COMPUTINGTHREAD_H
#define COMPUTINGTHREAD_H
#include <QThread>
class ImageBuffer;
class ComputingThread : public QThread
{
public:
ComputingThread();
~ComputingThread();
void haltComputing();
void startTransmitting();
void stopTransmitting();
protected:
void run();
private:
volatile bool halt;
volatile bool transmit;
ImageBuffer* imageBuffer;
};
#endif
To copy to clipboard, switch view to plain text mode
Bookmarks