File indexing completed on 2025-01-18 10:01:26
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <csignal>
0008 #include <thread>
0009 #include <fcntl.h>
0010 #include <unistd.h>
0011 #include <sys/stat.h>
0012
0013 #include <JANA/JApplication.h>
0014
0015
0016
0017 namespace JSignalHandler {
0018
0019 extern JApplication* g_app;
0020 extern int g_sigint_count;
0021 extern JLogger* g_logger;
0022 extern std::string g_path_to_named_pipe;
0023 extern std::map<pthread_t, std::string> g_thread_reports;
0024 extern std::atomic_int g_thread_report_count;
0025
0026
0027 void create_named_pipe(const std::string& path_to_named_pipe);
0028 void send_to_named_pipe(const std::string& path_to_named_pipe, const std::string& data);
0029 void produce_thread_report();
0030 std::string produce_overall_report();
0031 void send_overall_report_to_named_pipe();
0032 void handle_sigint(int);
0033 void handle_usr1(int);
0034 void handle_usr2(int);
0035 void handle_sigsegv(int , siginfo_t* , void* );
0036 void register_handlers(JApplication* app);
0037
0038 };
0039