mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-13 21:29:31 +01:00
refine threadpool mutex, remove unlock before destroying, unlocking twice is undefined behaviour
This commit is contained in:
@@ -294,9 +294,8 @@ multiSlsDetector::~multiSlsDetector() {
|
||||
|
||||
|
||||
int multiSlsDetector::createThreadPool(){
|
||||
if(threadpool){
|
||||
threadpool->destroy_threadpool();
|
||||
}
|
||||
if(threadpool)
|
||||
destroyThreadPool();
|
||||
int numthreads = thisMultiDetector->numberOfDetectors;
|
||||
if(numthreads < 1){
|
||||
numthreads = 1; //create threadpool anyway, threads initialized only when >1 detector added
|
||||
@@ -322,7 +321,6 @@ int multiSlsDetector::createThreadPool(){
|
||||
|
||||
void multiSlsDetector::destroyThreadPool(){
|
||||
if(threadpool){
|
||||
threadpool->destroy_threadpool();
|
||||
delete threadpool;
|
||||
threadpool=0;
|
||||
#ifdef VERBOSE
|
||||
|
||||
Reference in New Issue
Block a user