MPSolve 3.2.1
Loading...
Searching...
No Matches
mps_thread Struct Reference

A thread that is part of a thread pool. More...

#include <threading.h>

Public Attributes

mps_thread_poolpool
 Pool of which this thread is part.
 
pthread_t * thread
 The pthread_t assigned to the worked.
 
mps_threadnext
 The next thread in the pool, or NULL if this is the last thread contained in it.
 
mps_thread_worker_datadata
 The data assigned to this thread, that sets the worker that he has to do.
 
mps_boolean busy
 True if the thread is busy.
 
pthread_mutex_t busy_mutex
 Busy mutex of the thread. This is locked when the thread is doing something, se we can emulate a join on it by try to lock and unlock this mutex.
 
pthread_cond_t start_condition
 Condition that allow the thread to run. Before the thread finish the busy state (unlocking the busy mutex) or when it is created, it waits for the start condition to be true before doing anything.
 
mps_boolean alive
 A boolean value that is true if the thread must continue to poll, or false if it is required to exit. Since the thread may be waiting for work a call to pthread_cond_signal on start condition may be required to make it exit after setting this variable.
 
mps_thread_work work
 The routine that must be called when the thread starts.
 
void * args
 The argument to be passed to the thread.
 

Detailed Description

A thread that is part of a thread pool.


The documentation for this struct was generated from the following file: