aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/future/core
diff options
context:
space:
mode:
authorlexeyo <lexeyo@yandex-team.ru>2022-02-10 16:50:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:52 +0300
commit7bd28c29ae2a1fba7a03bcf4c658af66fe1373bf (patch)
tree125a82183c08c617e85c03a2036a11878fe21fce /library/cpp/threading/future/core
parent00b32f5b0810b417c619169d137c29a64b54d464 (diff)
downloadydb-7bd28c29ae2a1fba7a03bcf4c658af66fe1373bf.tar.gz
Restoring authorship annotation for <lexeyo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/future/core')
-rw-r--r--library/cpp/threading/future/core/future-inl.h70
-rw-r--r--library/cpp/threading/future/core/future.h30
2 files changed, 50 insertions, 50 deletions
diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h
index 5fd4296a93..128d6d967b 100644
--- a/library/cpp/threading/future/core/future-inl.h
+++ b/library/cpp/threading/future/core/future-inl.h
@@ -506,32 +506,32 @@ namespace NThreading {
////////////////////////////////////////////////////////////////////////////////
- class TFutureStateId {
- private:
- const void* Id;
-
- public:
- template <typename T>
- explicit TFutureStateId(const NImpl::TFutureState<T>& state)
- : Id(&state)
- {
- }
-
- const void* Value() const noexcept {
- return Id;
- }
- };
-
- inline bool operator==(const TFutureStateId& l, const TFutureStateId& r) {
- return l.Value() == r.Value();
- }
-
- inline bool operator!=(const TFutureStateId& l, const TFutureStateId& r) {
- return !(l == r);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
-
+ class TFutureStateId {
+ private:
+ const void* Id;
+
+ public:
+ template <typename T>
+ explicit TFutureStateId(const NImpl::TFutureState<T>& state)
+ : Id(&state)
+ {
+ }
+
+ const void* Value() const noexcept {
+ return Id;
+ }
+ };
+
+ inline bool operator==(const TFutureStateId& l, const TFutureStateId& r) {
+ return l.Value() == r.Value();
+ }
+
+ inline bool operator!=(const TFutureStateId& l, const TFutureStateId& r) {
+ return !(l == r);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+
template <typename T>
inline TFuture<T>::TFuture(const TIntrusivePtr<TFutureState>& state) noexcept
: State(state)
@@ -642,11 +642,11 @@ namespace NThreading {
}
template <typename T>
- inline TMaybe<TFutureStateId> TFuture<T>::StateId() const noexcept {
- return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing();
- }
-
- template <typename T>
+ inline TMaybe<TFutureStateId> TFuture<T>::StateId() const noexcept {
+ return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing();
+ }
+
+ template <typename T>
inline void TFuture<T>::EnsureInitialized() const {
if (!State) {
ythrow TFutureException() << "state not initialized";
@@ -745,10 +745,10 @@ namespace NThreading {
return bool(State);
}
- inline TMaybe<TFutureStateId> TFuture<void>::StateId() const noexcept {
- return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing();
- }
-
+ inline TMaybe<TFutureStateId> TFuture<void>::StateId() const noexcept {
+ return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing();
+ }
+
inline void TFuture<void>::EnsureInitialized() const {
if (!State) {
ythrow TFutureException() << "state not initialized";
diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h
index 2e82bb953e..93b5188c99 100644
--- a/library/cpp/threading/future/core/future.h
+++ b/library/cpp/threading/future/core/future.h
@@ -4,7 +4,7 @@
#include <util/datetime/base.h>
#include <util/generic/function.h>
-#include <util/generic/maybe.h>
+#include <util/generic/maybe.h>
#include <util/generic/ptr.h>
#include <util/generic/vector.h>
#include <util/generic/yexception.h>
@@ -61,9 +61,9 @@ namespace NThreading {
template <typename F, typename T>
using TFutureCallResult = typename NImpl::TFutureCallResult<F, T>::TType;
- //! Type of the future/promise state identifier
- class TFutureStateId;
-
+ //! Type of the future/promise state identifier
+ class TFutureStateId;
+
////////////////////////////////////////////////////////////////////////////////
template <typename T>
@@ -113,11 +113,11 @@ namespace NThreading {
TFuture<void> IgnoreResult() const;
- //! If the future is initialized returns the future state identifier. Otherwise returns an empty optional
- /** The state identifier is guaranteed to be unique during the future state lifetime and could be reused after its death
- **/
- TMaybe<TFutureStateId> StateId() const noexcept;
-
+ //! If the future is initialized returns the future state identifier. Otherwise returns an empty optional
+ /** The state identifier is guaranteed to be unique during the future state lifetime and could be reused after its death
+ **/
+ TMaybe<TFutureStateId> StateId() const noexcept;
+
void EnsureInitialized() const;
};
@@ -172,12 +172,12 @@ namespace NThreading {
TFuture<void> IgnoreResult() const {
return *this;
}
-
- //! If the future is initialized returns the future state identifier. Otherwise returns an empty optional
- /** The state identifier is guaranteed to be unique during the future state lifetime and could be reused after its death
- **/
- TMaybe<TFutureStateId> StateId() const noexcept;
-
+
+ //! If the future is initialized returns the future state identifier. Otherwise returns an empty optional
+ /** The state identifier is guaranteed to be unique during the future state lifetime and could be reused after its death
+ **/
+ TMaybe<TFutureStateId> StateId() const noexcept;
+
void EnsureInitialized() const;
};