aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/future/core
diff options
context:
space:
mode:
authorasorotsky <asorotsky@yandex-team.ru>2022-02-10 16:47:33 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:33 +0300
commiteb540cc7a103419462d0cc870ca403966e2194c6 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/threading/future/core
parent80f0a6b4102e3b2c89f23935c7690409033ea24c (diff)
downloadydb-eb540cc7a103419462d0cc870ca403966e2194c6.tar.gz
Restoring authorship annotation for <asorotsky@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/future/core')
-rw-r--r--library/cpp/threading/future/core/future-inl.h46
-rw-r--r--library/cpp/threading/future/core/future.h4
2 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h
index 3973b9c170..5fd4296a93 100644
--- a/library/cpp/threading/future/core/future-inl.h
+++ b/library/cpp/threading/future/core/future-inl.h
@@ -16,10 +16,10 @@ namespace NThreading {
////////////////////////////////////////////////////////////////////////////////
- enum class TError {
- Error
- };
-
+ enum class TError {
+ Error
+ };
+
template <typename T>
class TFutureState: public TAtomicRefCount<TFutureState<T>> {
enum {
@@ -89,13 +89,13 @@ namespace NThreading {
{
}
- TFutureState(std::exception_ptr exception, TError)
- : State(ExceptionSet)
- , Exception(std::move(exception))
- , NullValue(0)
- {
- }
-
+ TFutureState(std::exception_ptr exception, TError)
+ : State(ExceptionSet)
+ , Exception(std::move(exception))
+ , NullValue(0)
+ {
+ }
+
~TFutureState() {
if (State >= ValueMoved) { // ValueMoved, ValueSet, ValueRead
Value.~T();
@@ -277,12 +277,12 @@ namespace NThreading {
{
}
- TFutureState(std::exception_ptr exception, TError)
- : State(ExceptionSet)
- , Exception(std::move(exception))
- {
- }
-
+ TFutureState(std::exception_ptr exception, TError)
+ : State(ExceptionSet)
+ , Exception(std::move(exception))
+ {
+ }
+
bool HasValue() const {
return AtomicGet(State) == ValueSet;
}
@@ -971,12 +971,12 @@ namespace NThreading {
return Singleton<TCache>()->Instance;
}
- template <typename T>
- inline TFuture<T> MakeErrorFuture(std::exception_ptr exception)
- {
- return {new NImpl::TFutureState<T>(std::move(exception), NImpl::TError::Error)};
- }
-
+ template <typename T>
+ inline TFuture<T> MakeErrorFuture(std::exception_ptr exception)
+ {
+ return {new NImpl::TFutureState<T>(std::move(exception), NImpl::TError::Error)};
+ }
+
inline TFuture<void> MakeFuture() {
struct TCache {
TFuture<void> Instance{new NImpl::TFutureState<void>(true)};
diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h
index b8442f94c6..2e82bb953e 100644
--- a/library/cpp/threading/future/core/future.h
+++ b/library/cpp/threading/future/core/future.h
@@ -28,8 +28,8 @@ namespace NThreading {
TFuture<std::remove_reference_t<T>> MakeFuture(T&& value);
template <typename T>
TFuture<T> MakeFuture();
- template <typename T>
- TFuture<T> MakeErrorFuture(std::exception_ptr exception);
+ template <typename T>
+ TFuture<T> MakeErrorFuture(std::exception_ptr exception);
TFuture<void> MakeFuture();
////////////////////////////////////////////////////////////////////////////////