mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-05 17:40:40 +02:00
Dev/detach pthreads not joining (#1019)
* detach the pthreads that are not joining else memory leak * removed the clean up comment, also refactored the pthread join/detach for ctb 1g
This commit is contained in:
parent
06266f3905
commit
5088e5a205
Binary file not shown.
@ -2209,7 +2209,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
Binary file not shown.
@ -2572,7 +2572,8 @@ int startStateMachine() {
|
||||
sharedMemory_setStatus(IDLE);
|
||||
sharedMemory_unlockAcqFlag();
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(virtual_tid);
|
||||
LOG(logINFO, ("Virtual Acquisition started\n"));
|
||||
sharedMemory_unlockAcqFlag();
|
||||
return OK;
|
||||
|
Binary file not shown.
@ -3380,7 +3380,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
Binary file not shown.
@ -1667,7 +1667,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
Binary file not shown.
@ -2734,7 +2734,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
Binary file not shown.
@ -1858,7 +1858,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
Binary file not shown.
@ -2532,7 +2532,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
@ -91,7 +91,7 @@ static inline void FILELOG_PrintLog(enum TLogLevel level, char *m) {
|
||||
}
|
||||
|
||||
static inline char *FILELOG_BuildLog(const char *fmt, ...) {
|
||||
char *p;
|
||||
char *p = NULL;
|
||||
va_list ap;
|
||||
p = malloc(ERROR_MSG_LENGTH);
|
||||
va_start(ap, fmt);
|
||||
|
@ -2117,7 +2117,8 @@ int acquire(int blocking, int file_des) {
|
||||
// scanErrorMessage)
|
||||
if (blocking || !scan) {
|
||||
pthread_join(pthread_tid, NULL);
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_tid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2213,6 +2214,13 @@ void *start_state_machine(void *arg) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not start read frames thread!\n");
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
// blocking or scan
|
||||
// wait to finish reading from fifo (1g real ctb)
|
||||
if (*blocking || times > 1)
|
||||
pthread_join(pthread_tid_ctb_1g, NULL);
|
||||
else
|
||||
pthread_detach(pthread_tid_ctb_1g);
|
||||
}
|
||||
}
|
||||
// add scan error message
|
||||
@ -2229,12 +2237,6 @@ void *start_state_machine(void *arg) {
|
||||
#endif
|
||||
// blocking or scan
|
||||
if (*blocking || times > 1) {
|
||||
// wait to finish reading from fifo (1g real ctb)
|
||||
#if defined(CHIPTESTBOARDD) && !defined(VIRTUAL)
|
||||
if (!enableTenGigabitEthernet(-1)) {
|
||||
pthread_join(pthread_tid_ctb_1g, NULL);
|
||||
}
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
waitForAcquisitionEnd(&ret, mess);
|
||||
if (ret == FAIL && scan) {
|
||||
@ -7861,7 +7863,6 @@ int set_pattern(int file_des) {
|
||||
!defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
|
||||
patternParameters *pat = malloc(sizeof(patternParameters));
|
||||
memset(pat, 0, sizeof(patternParameters));
|
||||
// ignoring endianness for eiger
|
||||
@ -8515,7 +8516,8 @@ int start_readout(int file_des) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not start read frames thread!\n");
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_tid_ctb_1g);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Binary file not shown.
@ -1329,7 +1329,8 @@ int startStateMachine() {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
sharedMemory_setStatus(IDLE);
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
pthread_detach(pthread_virtual_tid);
|
||||
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
|
||||
return OK;
|
||||
#endif
|
||||
|
@ -2,13 +2,13 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
/** API versions */
|
||||
#define RELEASE "developer"
|
||||
#define APICTB "developer 0x240918"
|
||||
#define APIGOTTHARD "developer 0x240918"
|
||||
#define APIMOENCH "developer 0x240918"
|
||||
#define APIXILINXCTB "developer 0x240918"
|
||||
#define APIEIGER "developer 0x240918"
|
||||
#define APIMYTHEN3 "developer 0x241001"
|
||||
#define APIRECEIVER "developer 0x241014"
|
||||
#define APILIB "developer 0x241021"
|
||||
#define APIGOTTHARD2 "developer 0x241022"
|
||||
#define APIJUNGFRAU "developer 0x241024"
|
||||
#define APICTB "developer 0x241107"
|
||||
#define APIGOTTHARD "developer 0x241107"
|
||||
#define APIGOTTHARD2 "developer 0x241107"
|
||||
#define APIJUNGFRAU "developer 0x241107"
|
||||
#define APIMYTHEN3 "developer 0x241107"
|
||||
#define APIMOENCH "developer 0x241107"
|
||||
#define APIXILINXCTB "developer 0x241107"
|
||||
#define APIEIGER "developer 0x241107"
|
||||
|
Loading…
x
Reference in New Issue
Block a user