forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmptyWaitingTask.h
27 lines (22 loc) · 903 Bytes
/
EmptyWaitingTask.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef EmptyWaitingTask_h
#define EmptyWaitingTask_h
// from FWCore/Concurrency/interface/WaitingTaskList.h
#include "Framework/WaitingTask.h"
namespace edm {
class EmptyWaitingTask : public WaitingTask {
public:
EmptyWaitingTask() = default;
tbb::task* execute() override { return nullptr; }
};
namespace waitingtask {
struct TaskDestroyer {
void operator()(tbb::task* iTask) const { tbb::task::destroy(*iTask); }
};
} // namespace waitingtask
///Create an EmptyWaitingTask which will properly be destroyed
inline std::unique_ptr<edm::EmptyWaitingTask, waitingtask::TaskDestroyer> make_empty_waiting_task() {
return std::unique_ptr<edm::EmptyWaitingTask, waitingtask::TaskDestroyer>(new (tbb::task::allocate_root())
edm::EmptyWaitingTask{});
}
} // namespace edm
#endif