@@ -58,7 +58,7 @@ class RTPathCPUSampler;
5858class RTPathCPURenderEngine : public PathCPURenderEngine {
5959public:
6060 RTPathCPURenderEngine (RenderConfigRef cfg);
61- ~RTPathCPURenderEngine ();
61+ virtual ~RTPathCPURenderEngine () = default ;
6262
6363 virtual RenderEngineType GetType () const { return GetObjectType (); }
6464 virtual std::string GetTag () const { return GetObjectTag (); }
@@ -80,15 +80,11 @@ class RTPathCPURenderEngine : public PathCPURenderEngine {
8080 friend class RTPathCPURenderThread ;
8181 friend class RTPathCPUSampler ;
8282
83- struct completion_t {
84- void operator ()() noexcept { }
85- };
86-
8783protected:
8884 static luxrays::PropertiesUPtr GetDefaultProps ();
8985
9086 virtual bool IsRTMode () const { return true ; }
91-
87+
9288 CPURenderThreadUPtr NewRenderThread (const u_int index,
9389 luxrays::IntersectionDevice *device) {
9490 return std::make_unique<RTPathCPURenderThread>(this , index, device);
@@ -113,10 +109,12 @@ class RTPathCPURenderEngine : public PathCPURenderEngine {
113109
114110 std::mutex firstFrameMutex;
115111 std::condition_variable firstFrameCondition;
116- u_int firstFrameThreadDoneCount;
112+ std::atomic< u_int> firstFrameThreadDoneCount;
117113 bool firstFrameDone;
118114
119- std::barrier<completion_t > *threadsSyncBarrier;
115+ using CompletionFunction = std::function<void ()>;
116+ std::unique_ptr<std::barrier<CompletionFunction>> threadsSyncBarrier; // General sync
117+ std::unique_ptr<std::barrier<CompletionFunction>> threadsPauseBarrier; // Dedicated to pause event
120118 std::atomic<bool > threadsPauseMode;
121119};
122120
0 commit comments