diff --git a/components/sceneutil/workqueue.cpp b/components/sceneutil/workqueue.cpp index 0c68c61921..eb7a7b2cae 100644 --- a/components/sceneutil/workqueue.cpp +++ b/components/sceneutil/workqueue.cpp @@ -46,9 +46,12 @@ WorkQueue::~WorkQueue() void WorkQueue::start(std::size_t workerThreads) { + { + const std::lock_guard lock(mMutex); + mIsReleased = false; + } while (mThreads.size() < workerThreads) mThreads.emplace_back(std::make_unique(*this)); - mIsReleased = false; } void WorkQueue::stop()