| 126 | lfs::vis::RenderingManager* getRenderingManager() override { return nullptr; } |
| 127 | |
| 128 | bool postWork(WorkItem work) override { |
| 129 | ++post_work_calls; |
| 130 | if (!accepts_posted_work) { |
| 131 | if (work.cancel) { |
| 132 | work.cancel(); |
| 133 | } |
| 134 | return false; |
| 135 | } |
| 136 | if (queue_posted_work) { |
| 137 | { |
| 138 | std::lock_guard lock(queued_work_mutex); |
| 139 | queued_work.push_back(std::move(work)); |
| 140 | } |
| 141 | queued_work_cv.notify_all(); |
| 142 | return true; |
| 143 | } |
| 144 | if (work.run) { |
| 145 | work.run(); |
| 146 | } |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | [[nodiscard]] bool isOnViewerThread() const override { return on_viewer_thread; } |
| 151 | [[nodiscard]] bool acceptsPostedWork() const override { return accepts_posted_work; } |