1 #ifndef FWCore_Concurrency_WaitingThreadPool_h 2 #define FWCore_Concurrency_WaitingThreadPool_h 8 #include <condition_variable> 24 template <
typename F,
typename G>
28 std::shared_ptr<WaitingThread> thisPtr) {
29 std::unique_lock lk(
mutex_);
32 errorContext = std::forward<G>(errorContextFunc)]()
mutable {
36 e.addContext(errorContext());
49 std::unique_lock lk(
mutex_);
98 template <
typename F,
typename G>
100 auto thread = pool_.makeOrGet([]() {
return std::make_unique<impl::WaitingThread>(); });
101 thread->run(
std::move(holder), std::forward<F>(
func), std::forward<G>(errorContextFunc),
std::move(thread));
~WaitingThread() noexcept
edm::ReusableObjectHolder< impl::WaitingThread > pool_
#define CMS_THREAD_GUARD(_var_)
void runAsync(WaitingTaskWithArenaHolder holder, F &&func, G &&errorContextFunc)
std::shared_ptr< WaitingThread > thisPtr_
void run(WaitingTaskWithArenaHolder holder, F &&func, G &&errorContextFunc, std::shared_ptr< WaitingThread > thisPtr)
void threadLoop() noexcept
void presetTaskAsFailed(std::exception_ptr iExcept) noexcept
WaitingThread & operator=(WaitingThread &&)=delete
auto wrap(F iFunc) -> decltype(iFunc())
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
std::condition_variable cond_
std::function< void()> func_