1411 pthread_mutex_lock(&(myself->
_mutex));
1413 pthread_mutex_unlock(&(myself->
_mutex));
1414 uint32_t threadToWaitForBeforeWriting = (myID == 0) ? myself->
_numThreads-1 : myID-1;
1426 while (myself->
_threadIndex != threadToWaitForBeforeWriting)
1429 pthread_mutex_lock(&(myself->
_mutex));
1432 pthread_mutex_unlock(&(myself->
_mutex));
uint32_t _numThreads
The number of threads that will be used to compress.
static const uint32_t _THREAD_WRITE_
Thread writing data to disk.
vector< uint32_t > _threadStatus
Flag telling whether the buffer to be transposed (and compressed) is full or empty.
static const uint32_t _THREAD_WAIT_
Thread doing nothing.
uint64_t compressBuffer(uint32_t threadIndex)
compresses one buffer of data, the one given by threadIndex
static const uint32_t _THREAD_EXIT_
Thread exiting.
pthread_mutex_t _mutex
mutex for compressing threads
bool writeCompressedDataToDisk(uint32_t threadID, uint32_t sizeToWrite)
writes an already compressed buffer to disk
uint32_t _threadIndex
A variable to assign threads indices.
static const uint32_t _THREAD_COMPRESS_
Thread working, compressing.