diff options
| author | 2017-11-17 10:46:32 +0100 | |
|---|---|---|
| committer | 2021-01-15 23:48:51 +0000 | |
| commit | 0442a8694dfb4f04a2d3da9290627c92483d50f2 (patch) | |
| tree | 09bc04c7b16121dc73cd5ef065e958a82e1ce223 /libs/gui/BLASTBufferQueue.cpp | |
| parent | 16b0b20f16a922581da0840e0047c58fe5bba959 (diff) | |
Flush BC_FREE_BUFFER and ref ops from non-looper threads.
BC_FREE_BUFFER and ref commands are normally just queued, and not
automatically flushed out to the kernel driver. This usually works fine,
because BC_FREE_BUFFER is typically called from a binder thread (which
flushes when calling back into the kernel), or a thread making regular
binder transactions itself.
But it can happen that a Parcel is destructed from a thread that meets
neither of those requirements; especially Parcels created from Java are
sensitive to this, because if they aren't immediately recycled, they
will instead be garbage collected, and in that case the BC_FREE_BUFFER
will be queued to the FinalizerDaemon thread, which otherwise never
makes or receives any binder calls.
To prevent these commands from getting stuck, flush BC_FREE_BUFFER and
refcount operations automatically from such threads.
Bug: 68604253
Bug: 139697085
Test: boots, binderLibTest
Change-Id: I98109a7046c122db22af0b15a268629284f06663
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
0 files changed, 0 insertions, 0 deletions