1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Command to disable state serializer (#1011)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-05-31 20:50:31 +03:00 committed by GitHub
parent 229d6a8ee9
commit 74801d00b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 190 additions and 16 deletions

View file

@ -20,6 +20,7 @@
#include <atomic>
#include <memory>
#include "Status.h"
namespace td {
@ -38,6 +39,12 @@ class CancellationToken {
}
return token_->is_cancelled_.load(std::memory_order_acquire);
}
Status check() const {
if (*this) {
return Status::Error(653, "cancelled"); // cancelled = 653
}
return Status::OK();
}
CancellationToken() = default;
explicit CancellationToken(std::shared_ptr<detail::RawCancellationToken> token) : token_(std::move(token)) {
}