userver: userver/engine/task/current_task.hpp Source File
Loading...
Searching...
No Matches
current_task.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <cstddef>
7#include <cstdint>
8
10
11USERVER_NAMESPACE_BEGIN
12
13namespace engine::ev {
14class ThreadControl;
15} // namespace engine::ev
16
17namespace engine {
18
19class Deadline;
20
22namespace current_task {
23
26bool IsTaskProcessorThread() noexcept;
27
30
38
41
43std::size_t GetStackSize();
44
46// Returns ev thread handle, internal use only
47ev::ThreadControl& GetEventThread();
49
50namespace impl {
51
52// For internal use only.
53void* GetRawCurrentTaskContext() noexcept;
54
55// For internal use only.
56bool IsCritical();
57
58// Note: an actually useful deadline should be acquired from server::request::GetTaskInheritedDeadline.
59// For internal use only.
60Deadline GetDeadline() noexcept;
61
62} // namespace impl
63
64} // namespace current_task
65
66namespace impl {
67
68// For internal use only.
69std::uint64_t GetCreatedTaskCount(TaskProcessor&);
70
71} // namespace impl
72
73} // namespace engine
74
75USERVER_NAMESPACE_END