mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
somewhere
This commit is contained in:
@ -16,20 +16,18 @@ ThreadObject::ThreadObject(int ind):
|
||||
index(ind),
|
||||
alive(false),
|
||||
killThread(false),
|
||||
thread(0) {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
thread(0)
|
||||
{
|
||||
PrintMembers();
|
||||
}
|
||||
|
||||
|
||||
ThreadObject::~ThreadObject() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
DestroyThread();
|
||||
}
|
||||
|
||||
|
||||
void ThreadObject::PrintMembers() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
FILE_LOG (logDEBUG) << "Index : " << index
|
||||
<< "\nalive: " << alive
|
||||
<< "\nkillThread: " << killThread
|
||||
@ -38,7 +36,6 @@ void ThreadObject::PrintMembers() {
|
||||
|
||||
|
||||
void ThreadObject::DestroyThread() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
if(alive){
|
||||
killThread = true;
|
||||
sem_post(&semaphore);
|
||||
@ -52,7 +49,6 @@ void ThreadObject::DestroyThread() {
|
||||
|
||||
|
||||
int ThreadObject::CreateThread() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
if(alive){
|
||||
FILE_LOG (logERROR) << "Cannot create thread " << index << ". Already alive";
|
||||
return FAIL;
|
||||
@ -72,16 +68,12 @@ int ThreadObject::CreateThread() {
|
||||
|
||||
|
||||
void* ThreadObject::StartThread(void* thisPointer) {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
((ThreadObject*)thisPointer)->RunningThread();
|
||||
return thisPointer;
|
||||
((ThreadObject*)thisPointer)->RunningThread();
|
||||
return thisPointer;
|
||||
}
|
||||
|
||||
|
||||
void ThreadObject::RunningThread() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
|
||||
|
||||
while(true) {
|
||||
|
||||
while(IsRunning()) {
|
||||
|
Reference in New Issue
Block a user