mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-01 07:44:55 +01:00
rxr: switched to threads for threadObject (from pthread), moved priorities to threadObject, mutex
This commit is contained in:
@@ -30,7 +30,7 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
|
||||
bool* fp, bool* act, bool* depaden, bool* sm, bool* qe,
|
||||
std::vector <int> * cdl, int* cdo, int* cad) :
|
||||
|
||||
ThreadObject(ind),
|
||||
ThreadObject(ind, TypeName),
|
||||
runningFlag(false),
|
||||
generalData(nullptr),
|
||||
fifo(f),
|
||||
@@ -62,7 +62,6 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
|
||||
rawDataModifyReadyCallBack(nullptr),
|
||||
pRawDataReady(nullptr)
|
||||
{
|
||||
ThreadObject::CreateThread();
|
||||
FILE_LOG(logDEBUG) << "DataProcessor " << ind << " created";
|
||||
memset((void*)&timerBegin, 0, sizeof(timespec));
|
||||
}
|
||||
@@ -71,13 +70,9 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
|
||||
DataProcessor::~DataProcessor() {
|
||||
delete file;
|
||||
delete [] tempBuffer;
|
||||
ThreadObject::DestroyThread();
|
||||
}
|
||||
|
||||
/** getters */
|
||||
std::string DataProcessor::GetType(){
|
||||
return TypeName;
|
||||
}
|
||||
|
||||
bool DataProcessor::IsRunning() {
|
||||
return runningFlag;
|
||||
@@ -155,20 +150,6 @@ void DataProcessor::SetGeneralData(GeneralData* g) {
|
||||
}
|
||||
|
||||
|
||||
void DataProcessor::SetThreadPriority(int priority) {
|
||||
struct sched_param param;
|
||||
param.sched_priority = priority;
|
||||
if (pthread_setschedparam(thread, SCHED_FIFO, ¶m) == EPERM) {
|
||||
if (!index) {
|
||||
FILE_LOG(logWARNING) << "Could not prioritize dataprocessing thread. "
|
||||
"(No Root Privileges?)";
|
||||
}
|
||||
} else {
|
||||
FILE_LOG(logINFO) << "Priorities set - DataProcessor: " << priority;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DataProcessor::SetFileFormat(const fileFormat f) {
|
||||
if ((file != nullptr) && file->GetFileType() != f) {
|
||||
//remember the pointer values before they are destroyed
|
||||
|
||||
Reference in New Issue
Block a user