mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
asyncResourceGatherer: do not detach worker threads (#477)
Worker threads become non-joinable once they are detached, and `await()` will not wait for them to finish. This can lead to a crash when `asyncResourceGatherer` is destroyed in the main thread while it is still being used in worker threads.
This commit is contained in:
parent
73b0fc26c0
commit
0b030d33c8
1 changed files with 1 additions and 4 deletions
|
@ -18,10 +18,7 @@ CAsyncResourceGatherer::CAsyncResourceGatherer() {
|
||||||
enqueueDMAFrames();
|
enqueueDMAFrames();
|
||||||
|
|
||||||
initialGatherThread = std::thread([this]() { this->gather(); });
|
initialGatherThread = std::thread([this]() { this->gather(); });
|
||||||
initialGatherThread.detach();
|
asyncLoopThread = std::thread([this]() { this->asyncAssetSpinLock(); });
|
||||||
|
|
||||||
asyncLoopThread = std::thread([this]() { this->asyncAssetSpinLock(); });
|
|
||||||
asyncLoopThread.detach();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAsyncResourceGatherer::enqueueDMAFrames() {
|
void CAsyncResourceGatherer::enqueueDMAFrames() {
|
||||||
|
|
Loading…
Reference in a new issue