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:
parent
229d6a8ee9
commit
74801d00b8
19 changed files with 190 additions and 16 deletions
|
@ -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)) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue