mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
bugfixes + tonlib update
This commit is contained in:
parent
2f81361a02
commit
eecf05ca59
35 changed files with 734 additions and 193 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <atomic>
|
||||
#include <cstdlib>
|
||||
#include <mutex>
|
||||
|
||||
#if TD_ANDROID
|
||||
#include <android/log.h>
|
||||
|
@ -272,4 +273,26 @@ void process_fatal_error(CSlice message) {
|
|||
std::abort();
|
||||
}
|
||||
|
||||
namespace {
|
||||
std::mutex sdl_mutex;
|
||||
int sdl_cnt = 0;
|
||||
int sdl_verbosity = 0;
|
||||
|
||||
} // namespace
|
||||
ScopedDisableLog::ScopedDisableLog() {
|
||||
std::unique_lock<std::mutex> guard(sdl_mutex);
|
||||
if (sdl_cnt == 0) {
|
||||
sdl_verbosity = set_verbosity_level(std::numeric_limits<int>::min());
|
||||
}
|
||||
sdl_cnt++;
|
||||
}
|
||||
|
||||
ScopedDisableLog::~ScopedDisableLog() {
|
||||
std::unique_lock<std::mutex> guard(sdl_mutex);
|
||||
sdl_cnt--;
|
||||
if (sdl_cnt == 0) {
|
||||
set_verbosity_level(sdl_verbosity);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue