8#include <boost/smart_ptr/intrusive_ptr.hpp>
10#include <userver/engine/deadline.hpp>
12USERVER_NAMESPACE_BEGIN
30class TaskCancellationToken;
76class TaskCancellationBlocker
final {
78 TaskCancellationBlocker();
79 ~TaskCancellationBlocker();
81 TaskCancellationBlocker(
const TaskCancellationBlocker&) =
delete;
82 TaskCancellationBlocker(TaskCancellationBlocker&&) =
delete;
83 TaskCancellationBlocker& operator=(
const TaskCancellationBlocker&) =
delete;
84 TaskCancellationBlocker& operator=(TaskCancellationBlocker&&) =
delete;
87 impl::TaskContext& context_;
88 const bool was_allowed_;
102class TaskCancellationToken
final {
111 TaskCancellationToken(
const TaskCancellationToken&)
noexcept;
112 TaskCancellationToken(TaskCancellationToken&&)
noexcept;
113 TaskCancellationToken& operator=(
const TaskCancellationToken&)
noexcept;
114 TaskCancellationToken& operator=(TaskCancellationToken&&)
noexcept;
115 ~TaskCancellationToken();
127 explicit TaskCancellationToken(impl::TaskContext& context)
noexcept;
129 boost::intrusive_ptr<impl::TaskContext> context_;