Skip to content

Commit d63e9b2

Browse files
markchandlera-maurice
authored andcommitted
Automated g4 rollback of changelist 267625598.
*** Reason for rollback *** Dependent on Rolling back CL 267398802 which breaks linux build *** Original change description *** Add blocking methods Wait() and Await() to FutureBase and Future (respectively). Wait() just blocks until the future is completed, or a timeout expires. Await() blocks until the future is completed, or a timeout expires, and then returns a pointer to the future's result, or nullptr if the timeout expired. *** PiperOrigin-RevId: 267672880
1 parent 8221cd2 commit d63e9b2

File tree

4 files changed

+1
-97
lines changed

4 files changed

+1
-97
lines changed

app/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ set(common_SRCS
134134
src/callback.cc
135135
src/cleanup_notifier.cc
136136
src/function_registry.cc
137-
src/future.cc
138137
src/future_manager.cc
139138
src/path.cc
140139
src/reference_counted_future_impl.cc

app/src/future.cc

Lines changed: 0 additions & 57 deletions
This file was deleted.

app/src/include/firebase/future.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -146,27 +146,6 @@ class FutureBase {
146146
/// pending. Cast is required since GetFutureResult() returns void*.
147147
const void* result_void() const;
148148

149-
#if defined(INTERNAL_EXPERIMENTAL)
150-
/// Special timeout value indicating an infinite timeout.
151-
///
152-
/// Passing this value to FutureBase::Wait() or Future<T>::Await() will cause
153-
/// those methods to wait until the future is complete.
154-
///
155-
/// @Warning It is inadvisable to use this from code that could be called
156-
/// from an event loop.
157-
static const int kWaitTimeoutInfinite;
158-
159-
/// Block (i.e. suspend the current thread) until either the future is
160-
/// completed or the specified timeout period (in milliseconds) has elapsed.
161-
/// If `timeout_milliseconds` is `kWaitTimeoutInfinite`, then the timeout
162-
/// period is treated as being infinite, i.e. this will block until the
163-
/// future is completed.
164-
///
165-
/// @return True if the future completed, or
166-
/// false if the timeout period elapsed before the future completed.
167-
bool Wait(int timeout_milliseconds) const;
168-
#endif // defined(INTERNAL_EXPERIMENTAL)
169-
170149
/// Register a single callback that will be called at most once, when the
171150
/// future is completed.
172151
///
@@ -389,22 +368,6 @@ class Future : public FutureBase {
389368
return static_cast<const ResultType*>(result_void());
390369
}
391370

392-
#if defined(INTERNAL_EXPERIMENTAL)
393-
/// Waits (blocks) until either the future is completed, or the specified
394-
/// timeout period (in milliseconds) has elapsed, then returns the result of
395-
/// the asynchronous call.
396-
///
397-
/// This is a convenience method that calls Wait() and then returns result().
398-
///
399-
/// If `timeout_milliseconds` is `kWaitTimeoutInfinite`, then the timeout
400-
/// period is treated as being infinite, i.e. this will block until the
401-
/// future is completed.
402-
const ResultType* Await(int timeout_milliseconds) const {
403-
Wait(timeout_milliseconds);
404-
return result();
405-
}
406-
#endif // defined(INTERNAL_EXPERIMENTAL)
407-
408371
/// Register a single callback that will be called at most once, when the
409372
/// future is completed.
410373
///

app/src/thread_pthread.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,4 @@ void Thread::Detach() {
146146

147147
// NOLINTNEXTLINE - allow namespace overridden
148148
} // namespace FIREBASE_NAMESPACE
149-
150-
#endif // defined(_STLPORT_VERSION)
149+
#endif

0 commit comments

Comments
 (0)