hold worker busy state in renderbackend rather than in renderworker
Workers run in different threads and the backends can poll whether the worker is currently busy or not. However the previous iteration has the worker (and an atomic int) provide the busy state which could easily desync with the main thread (since all workers run in different threads). By holding the busy states in the main thread, the main thread will always be able to poll the busy state accurately.
This commit is contained in:
@@ -86,6 +86,9 @@ protected:
|
||||
|
||||
void UpdateNodeInputs();
|
||||
|
||||
bool WorkerIsBusy(RenderWorker* worker) const;
|
||||
void SetWorkerBusyState(RenderWorker* worker, bool busy);
|
||||
|
||||
QList<TimeRange> cache_queue_;
|
||||
|
||||
QVector<RenderWorker*> processors_;
|
||||
@@ -133,9 +136,9 @@ private:
|
||||
bool recompile_queued_;
|
||||
bool input_update_queued_;
|
||||
|
||||
private slots:
|
||||
void ThreadRequestedSibling(NodeDependency dep);
|
||||
QVector<bool> processor_busy_state_;
|
||||
|
||||
private slots:
|
||||
void QueueRecompile();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user