Re: [PATCH] rust_binder: Reuse the thread lock in get_work_local()
From: Alice Ryhl
Date: Tue Nov 24 2026 - 13:54:04 EST
On Tue, Nov 24, 2026 at 04:04:27PM +0100, Peder Bergan wrote:
> get_work_local() takes the thread lock to check looper_need_return.
> When the flag is clear, it drops and retakes the lock before trying to
> pop work for either a blocking or a nonblocking read.
>
> Keep the guard across the flag check and the first pop. A blocking
> read that finds no work still registers its wait before the condition
> variable releases the guard, so a producer can wake the reader.
>
> Signed-off-by: Peder Bergan <peder.bergan@xxxxxxxxx>
Looks good to me! Unlike get_work(), get_work_local() never needs to
acquire the process lock, so dropping self.inner between checking
looper_need_return and calling pop_work() was unnecessary.
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Alice