aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-05-04 15:53:41 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-05-04 15:53:41 +0300
commit4b3463e0a8c1b2c11eb8cd38f359e554f63e7a33 (patch)
tree6fad732ec7c65e4476729f0630c00604932865a8 /library
parent8e4ed04483aa4056df4c83b5e7d5792645add891 (diff)
downloadydb-4b3463e0a8c1b2c11eb8cd38f359e554f63e7a33.tar.gz
intermediate changes
ref:115e672de37d161b50b84f729a9688ac62d77601
Diffstat (limited to 'library')
-rw-r--r--library/cpp/threading/future/core/future-inl.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h
index d04fd54e29..a98175af2d 100644
--- a/library/cpp/threading/future/core/future-inl.h
+++ b/library/cpp/threading/future/core/future-inl.h
@@ -47,7 +47,7 @@ namespace NThreading {
};
void AccessValue(TDuration timeout, int acquireState) const {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state == NotReady)) {
if (timeout == TDuration::Zero()) {
::NThreading::NImpl::ThrowFutureException("value not set"sv, __LOCATION__);
@@ -109,7 +109,7 @@ namespace NThreading {
}
void TryRethrow() const {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
TryRethrowWithState(state);
}
@@ -141,7 +141,7 @@ namespace NThreading {
TCallbackList<T> callbacks;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state != NotReady)) {
return false;
}
@@ -180,7 +180,7 @@ namespace NThreading {
TCallbackList<T> callbacks;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state != NotReady)) {
return false;
}
@@ -210,7 +210,7 @@ namespace NThreading {
template <typename F>
bool Subscribe(F&& func) {
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (state == NotReady) {
Callbacks.emplace_back(std::forward<F>(func));
return true;
@@ -231,7 +231,7 @@ namespace NThreading {
TSystemEvent* readyEvent = nullptr;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (state != NotReady) {
return true;
}
@@ -246,7 +246,7 @@ namespace NThreading {
return readyEvent->WaitD(deadline);
}
- void TryRethrowWithState(int state) const {
+ void TryRethrowWithState(TAtomicBase state) const {
if (Y_UNLIKELY(state == ExceptionSet)) {
Y_ASSERT(Exception);
std::rethrow_exception(Exception);
@@ -290,7 +290,7 @@ namespace NThreading {
}
void TryRethrow() const {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
TryRethrowWithState(state);
}
@@ -299,7 +299,7 @@ namespace NThreading {
}
void GetValue(TDuration timeout = TDuration::Zero()) const {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state == NotReady)) {
if (timeout == TDuration::Zero()) {
::NThreading::NImpl::ThrowFutureException("value not set"sv, __LOCATION__);
@@ -329,7 +329,7 @@ namespace NThreading {
TCallbackList<void> callbacks;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state != NotReady)) {
return false;
}
@@ -366,7 +366,7 @@ namespace NThreading {
TCallbackList<void> callbacks;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (Y_UNLIKELY(state != NotReady)) {
return false;
}
@@ -396,7 +396,7 @@ namespace NThreading {
template <typename F>
bool Subscribe(F&& func) {
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (state == NotReady) {
Callbacks.emplace_back(std::forward<F>(func));
return true;
@@ -417,7 +417,7 @@ namespace NThreading {
TSystemEvent* readyEvent = nullptr;
with_lock (StateLock) {
- int state = AtomicGet(State);
+ TAtomicBase state = AtomicGet(State);
if (state != NotReady) {
return true;
}
@@ -432,7 +432,7 @@ namespace NThreading {
return readyEvent->WaitD(deadline);
}
- void TryRethrowWithState(int state) const {
+ void TryRethrowWithState(TAtomicBase state) const {
if (Y_UNLIKELY(state == ExceptionSet)) {
Y_ASSERT(Exception);
std::rethrow_exception(Exception);