commit | 89056eab62bab00fd86835e974004d6259ab2a1f | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@google.com> | Mon Sep 26 23:38:07 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Sep 26 23:38:07 2022 +0000 |
tree | 0c0cef45efa5b82f8d102ed0cb5ad099a36c2433 | |
parent | 37d9c872d26018b4232e12176e760ac7b0f24f78 [diff] |
pw_software_update: Fix recursive lock acquisition A recent change (I278f16834e95a4020bd7b8586f1878a475b82d60) added a lock acquisition to BundledUpdateService::SetTransferred, because the SET_ERROR macro requires the internal lock. However, it calls NotifyTransferSucceeded, which also acquires the lock. This means that any calls to SetTransferred deadlock on a recursive acquisition. This commit fixes the issue by moving the outer lock acquisition into the if statement that calls SET_ERROR, which is mutually exclusive with the call to NotifyTransferSucceeded. Tested: The SetTransferred RPC method no longer hangs. Change-Id: I0ee7994fa5e093a05e349876406d0a2bd89fc3e7 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112170 Pigweed-Auto-Submit: Eli Lipsitz <elipsitz@google.com> Reviewed-by: Ali Zhang <alizhang@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.