pw_rpc: ChannelOutput buffer handling fixes
- Ensure ChannelOutput buffers are always released when a call is
closed.
* Release any held buffer when aborting a server call due to an error.
* Permit calling AcquirePayloadBuffer() on an inactive call, but
return an empty buffer if it is called while inactive. Previously,
this was disallowed, but it may not be possible to prevent an
accidental AcquirePayloadBuffer() on a closed call if it is closed
by a different thread.
* Release any held buffer when a client call goes out of scope or is
aborted.
- Extend locking annotations to cover setting callbacks.
- Expose the function to end client streams as CloseClientStream().
Change-Id: I892c66bbeb1701329783b8c360d02ffe25992d98
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/78622
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.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/