8#include <boost/smart_ptr/intrusive_ptr.hpp>
10#include <userver/engine/deadline.hpp>
12USERVER_NAMESPACE_BEGIN
30class TaskCancellationToken;
73class TaskCancellationBlocker
final {
75 TaskCancellationBlocker();
76 ~TaskCancellationBlocker();
78 TaskCancellationBlocker(
const TaskCancellationBlocker&) =
delete;
79 TaskCancellationBlocker(TaskCancellationBlocker&&) =
delete;
80 TaskCancellationBlocker& operator=(
const TaskCancellationBlocker&) =
delete;
81 TaskCancellationBlocker& operator=(TaskCancellationBlocker&&) =
delete;
84 impl::TaskContext& context_;
85 const bool was_allowed_;
99class TaskCancellationToken
final {
108 TaskCancellationToken(
const TaskCancellationToken&)
noexcept;
109 TaskCancellationToken(TaskCancellationToken&&)
noexcept;
110 TaskCancellationToken& operator=(
const TaskCancellationToken&)
noexcept;
111 TaskCancellationToken& operator=(TaskCancellationToken&&)
noexcept;
112 ~TaskCancellationToken();
124 explicit TaskCancellationToken(impl::TaskContext& context)
noexcept;
126 boost::intrusive_ptr<impl::TaskContext> context_;