#include <Future-inl.h>
|
using | Clock = std::chrono::steady_clock |
|
Definition at line 610 of file Future-inl.h.
folly::futures::detail::WaitExecutor::WaitExecutor |
( |
| ) |
|
|
inlineprivate |
void folly::futures::detail::WaitExecutor::add |
( |
Func |
| ) |
|
|
inlineoverridevirtual |
Enqueue a function to executed by this executor. This and all variants must be threadsafe.
Implements folly::Executor.
Definition at line 612 of file Future-inl.h.
References folly::empty(), and folly::gen::move.
613 auto wQueue =
queue_.wlock();
614 if (wQueue->detached) {
617 bool empty = wQueue->funcs.empty();
618 wQueue->funcs.push_back(
std::move(func));
constexpr detail::Map< Move > move
constexpr auto empty(C const &c) -> decltype(c.empty())
folly::Synchronized< Queue > queue_
void folly::futures::detail::WaitExecutor::detach |
( |
| ) |
|
|
inline |
Definition at line 647 of file Future-inl.h.
References folly::gen::move.
650 auto wQueue =
queue_.wlock();
651 wQueue->detached =
true;
constexpr detail::Map< Move > move
folly::Synchronized< Queue > queue_
void folly::futures::detail::WaitExecutor::drive |
( |
| ) |
|
|
inline |
bool folly::futures::detail::WaitExecutor::driveUntil |
( |
Clock::time_point |
deadline | ) |
|
|
inline |
Definition at line 635 of file Future-inl.h.
References folly::exchange(), and folly::gen::move.
641 for (
auto& func : funcs) {
constexpr detail::Map< Move > move
T exchange(T &obj, U &&new_value)
bool try_wait_until(const std::chrono::time_point< Clock, Duration > &deadline)
folly::Synchronized< Queue > queue_
bool folly::futures::detail::WaitExecutor::keepAliveAcquire |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
Reimplemented from folly::Executor.
Definition at line 663 of file Future-inl.h.
664 auto keepAliveCount =
666 DCHECK(keepAliveCount > 0);
std::atomic< ssize_t > keepAliveCount_
void folly::futures::detail::WaitExecutor::keepAliveRelease |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
Reimplemented from folly::Executor.
Definition at line 670 of file Future-inl.h.
671 auto keepAliveCount =
673 DCHECK(keepAliveCount > 0);
674 if (keepAliveCount == 1) {
std::atomic< ssize_t > keepAliveCount_
std::atomic<ssize_t> folly::futures::detail::WaitExecutor::keepAliveCount_ {1} |
|
private |
The documentation for this class was generated from the following file: