1 #ifndef THREADS_HEADER_GUARD 2 #define THREADS_HEADER_GUARD 117 void operator=(
const Thread& );
141 std::thread internal_thread;
145 pthread_t internal_thread;
150 virtual void run() = 0;
152 virtual void preRun() = 0;
154 virtual void postRun() = 0;
156 virtual void preJoin();
158 virtual void postJoin();
169 static void* mainRun_(
void *p);
175 void setAffinity(
int i);
184 virtual void stopCall();
189 virtual void requestStopCall();
193 virtual void waitStopCall();
std::string name
Name of the thread.
Definition: thread.h:121
signal to AVThread or OpenGLThread. Also custom signals to custom Threads
Thread safe system of fifo and a stack.
bool loop
Use this boolean to control if the main loop in Thread:run should exit.
Definition: thread.h:135
A thread-safe combination of a fifo (first-in-first-out) queue and an associated stack.
Definition: framefifo.h:72
pthread_attr_t thread_attr
Thread attributes, pthread_* way.
Definition: thread.h:143
Encapsulates data sent by the signal.
Definition: thread.h:75
undefined (initial value)
Definition: usbthread.h:143
Signal
List of possible signals for the thread.
Definition: thread.h:61
A demo thread for testing the producer/consumer module for fifos.
Definition: thread.h:229
An example of information context sent to the Thread inside Thread::SignalContext.
Definition: thread.h:50
std::deque< SignalContext > signal_fifo
Signal queue (fifo). Redefine in child classes.
Definition: thread.h:134
std::mutex loop_mutex
Protects thread's main execution loop (if necessary)
Definition: thread.h:132
A demo thread for testing the producer/consumer module for fifos.
Definition: thread.h:205
FrameFifo * framefifo
Feed frames here.
Definition: thread.h:216
bool has_thread
true if thread has been started
Definition: thread.h:122
std::mutex mutex
Mutex protecting the condition variable and signal queue.
Definition: thread.h:129
A class for multithreading with a signaling system.
Definition: thread.h:90
std::condition_variable start_condition
Notified when the thread has been started.
Definition: thread.h:127
std::condition_variable condition
Condition variable for the signal queue (triggered when all signals processed). Not necessarily used ...
Definition: thread.h:130
FrameFifo * framefifo
Consume frames from here.
Definition: thread.h:240
std::mutex start_mutex
Mutex protecting start_condition.
Definition: thread.h:126