Added death handler

This commit is contained in:
Andrea Cavalli 2020-09-01 21:32:58 +02:00
parent 7316fe72eb
commit 5a2ee4d91b
3 changed files with 4 additions and 0 deletions

View File

@ -420,6 +420,7 @@ class MultiImplPool {
std::shared_ptr<MultiImpl> get() {
std::unique_lock<std::mutex> lock(mutex_);
if (impls_.empty()) {
Debug::DeathHandler dh;
init_openssl_threads();
impls_.resize(clamp(thread::hardware_concurrency(), 8u, 1000u) * 5 / 4);

View File

@ -4343,6 +4343,7 @@ static void on_fatal_error(const char *error) {
}
void main(int argc, char **argv) {
Debug::DeathHandler dh;
ignore_signal(SignalType::HangUp).ensure();
ignore_signal(SignalType::Pipe).ensure();
set_signal_handler(SignalType::Error, fail_signal).ensure();

View File

@ -10,12 +10,14 @@
#include "td/utils/OptionParser.h"
#include "td/utils/Slice.h"
#include "td/utils/tests.h"
#include "death_handler.h"
#if TD_EMSCRIPTEN
#include <emscripten.h>
#endif
int main(int argc, char **argv) {
Debug::DeathHandler dh;
td::init_openssl_threads();
td::TestsRunner &runner = td::TestsRunner::get_default();