8#include <boost/smart_ptr/intrusive_ptr.hpp>
10#include <userver/engine/deadline.hpp>
12USERVER_NAMESPACE_BEGIN
30class TaskCancellationToken;
65class TaskCancellationBlocker
final {
67 TaskCancellationBlocker();
68 ~TaskCancellationBlocker();
70 TaskCancellationBlocker(
const TaskCancellationBlocker&) =
delete;
71 TaskCancellationBlocker(TaskCancellationBlocker&&) =
delete;
72 TaskCancellationBlocker& operator=(
const TaskCancellationBlocker&) =
delete;
73 TaskCancellationBlocker& operator=(TaskCancellationBlocker&&) =
delete;
76 impl::TaskContext& context_;
77 const bool was_allowed_;
91class TaskCancellationToken
final {
100 TaskCancellationToken(
const TaskCancellationToken&)
noexcept;
101 TaskCancellationToken(TaskCancellationToken&&)
noexcept;
102 TaskCancellationToken& operator=(
const TaskCancellationToken&)
noexcept;
103 TaskCancellationToken& operator=(TaskCancellationToken&&)
noexcept;
104 ~TaskCancellationToken();
116 explicit TaskCancellationToken(impl::TaskContext& context)
noexcept;
118 boost::intrusive_ptr<impl::TaskContext> context_;