diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-09-19 11:54:48 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-09-19 11:54:48 +0800 |
commit | 1f228a245c017c29af2cc6b4940d54a1bde1ccf5 (patch) | |
tree | e5d6b84320a919b32b5e6d6bf7685b06e6e85265 /services/gpuservice/GpuService.cpp | |
parent | 49c3334ee7df733514a7eaf6add950324a77f53d (diff) | |
parent | ca7349a398d992d359e7b05f5a15cd5a3e37e6bb (diff) |
Merge tag 'LA.QSSI.13.0.r1-11500.01-qssi.0' into tachibana-mr1tachibana-mr1
"LA.QSSI.13.0.r1-11500.01-qssi.0"
Change-Id: Ic650a04d35ae3e9f8442cfd11e5a3c966fad882d
Diffstat (limited to 'services/gpuservice/GpuService.cpp')
-rw-r--r-- | services/gpuservice/GpuService.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/services/gpuservice/GpuService.cpp b/services/gpuservice/GpuService.cpp index 7b9782f4e8..5643940a6e 100644 --- a/services/gpuservice/GpuService.cpp +++ b/services/gpuservice/GpuService.cpp @@ -16,7 +16,7 @@ #define ATRACE_TAG ATRACE_TAG_GRAPHICS -#include "GpuService.h" +#include "gpuservice/GpuService.h" #include <android-base/stringprintf.h> #include <binder/IPCThreadState.h> @@ -34,6 +34,7 @@ #include <vkjson.h> #include <thread> +#include <memory> namespace android { @@ -55,18 +56,21 @@ GpuService::GpuService() mGpuStats(std::make_unique<GpuStats>()), mGpuMemTracer(std::make_unique<GpuMemTracer>()) { - std::thread gpuMemAsyncInitThread([this]() { + mGpuMemAsyncInitThread = std::make_unique<std::thread>([this] (){ mGpuMem->initialize(); mGpuMemTracer->initialize(mGpuMem); }); - gpuMemAsyncInitThread.detach(); - std::thread gpuWorkAsyncInitThread([this]() { + mGpuWorkAsyncInitThread = std::make_unique<std::thread>([this]() { mGpuWork->initialize(); }); - gpuWorkAsyncInitThread.detach(); }; +GpuService::~GpuService() { + mGpuWorkAsyncInitThread->join(); + mGpuMemAsyncInitThread->join(); +} + void GpuService::setGpuStats(const std::string& driverPackageName, const std::string& driverVersionName, uint64_t driverVersionCode, int64_t driverBuildTime, const std::string& appPackageName, |