freekill
26th November 2009, 05:12
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
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