commit | 5b53103e1076a700be79d7ed700b51f2077ccb0d | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Fri Jan 27 21:00:15 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jan 27 21:00:15 2023 +0000 |
tree | cc027bccdb5019d8509aa424f2fda9b79a466006 | |
parent | aaf7aa543ce96ded8b578fc337a4048ac34750ab [diff] |
pw_transfer: Set RPC streams directly Rather than passing the RPC stream to the transfer thread to be moved, set it directly. pw_rpc call objects are synchronized by pw_rpc, so it is safe to move them between threads. With upcoming pw_rpc changes, a thread will wait until an RPC call's callbacks finish before moving the call object. This could cause deadlocks in pw_transfer if a packet arrives immediately after the stream starts, before the transfer thread gets a chance to move the call object to its final location. The RPC thread would wait for the next event to be available in the callback, while the transfer thread would wait to move the new call object out of the next event until the callback completed, resulting in deadlock. This change avoids this issue without needing to drop any packets. Change-Id: I24b088e36b7712ceda042cdbe80e0b05dec480b7 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/126924 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Alexei Frolov <frolv@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/.