mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
debug
This commit is contained in:
parent
9508dd1adc
commit
222d9e4839
@ -13,6 +13,7 @@
|
||||
#include "singlePhotonDetector.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <csignal>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <stdio.h>
|
||||
@ -88,6 +89,13 @@ int adjustThreads(int requestedThreads, int nSC) {
|
||||
return adjustedThreads;
|
||||
}
|
||||
|
||||
// Signal handler for segmentation faults
|
||||
void signal_handler(int signum) {
|
||||
std::cerr << "Caught signal " << signum << ": Segmentation fault (core dump)" << std::endl;
|
||||
// Handle the error (e.g., clean up, abort, etc.)
|
||||
exit(signum); // Exit program with the signal code
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@ -103,6 +111,9 @@ int main(int argc, char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Set up the signal handler for segmentation faults
|
||||
signal(SIGSEGV, signal_handler);
|
||||
|
||||
int const fifosize = 100; //1000;
|
||||
int const nthreads = 10;
|
||||
int const csize = 3; // 3
|
||||
|
Loading…
x
Reference in New Issue
Block a user