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());
46 std::unique_lock lk(
mutex_);
95 template <
typename F,
typename G>
97 auto thread = pool_.makeOrGet([]() {
return std::make_unique<impl::WaitingThread>(); });
98 thread->run(
std::move(holder), std::forward<F>(
func), std::forward<G>(errorContextFunc),
std::move(thread));
~WaitingThread() noexcept
void doneWaiting(std::exception_ptr iExcept)
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
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_