From b9b9d7edcf3400a79f49ad777ece52e164b9d29d Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Tue, 11 Oct 2022 12:38:03 +0900 Subject: [PATCH] universal7885: parts-aidl: Don't call ->detach() According to cppreference.com, detach allows the thread to operate independently of thread handle, which is not our intent since we need it completely under control https://en.cppreference.com/w/cpp/thread/thread/detach --- .../apps/aidl-support/parts/default/SmartChargingImpl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/universal7885-common/apps/aidl-support/parts/default/SmartChargingImpl.cpp b/universal7885-common/apps/aidl-support/parts/default/SmartChargingImpl.cpp index c8c5a0b..3b9af85 100644 --- a/universal7885-common/apps/aidl-support/parts/default/SmartChargingImpl.cpp +++ b/universal7885-common/apps/aidl-support/parts/default/SmartChargingImpl.cpp @@ -33,7 +33,6 @@ void SmartChargeImpl::start(void) { shouldRun = true; monitor = new std::thread(battery_monitor, limit_percent, restart_percent, &charge_limit_cnt, &restart_cnt); - monitor->detach(); } void SmartChargeImpl::stop(void) {