diff options
| author | Alice Ryhl <aliceryhl@google.com> | 2025-11-25 13:59:41 +0000 |
|---|---|---|
| committer | Yury Norov (NVIDIA) <yury.norov@gmail.com> | 2025-12-02 14:17:09 -0500 |
| commit | f523d110a63b5b38ab5d54df1d06f1e0988c9b74 (patch) | |
| tree | 53b856d7973b180dbbae682afdcd60fee6543794 /tools/lib/python/kdoc/kdoc_files.py | |
| parent | 69ec6a1bed3017293a3430e2f8e3c01b29496446 (diff) | |
rust: id_pool: do not immediately acquire new ids
When Rust Binder assigns a new ID, it performs various fallible
operations before it "commits" to actually using the new ID. To support
this pattern, change acquire_next_id() so that it does not immediately
call set_bit(), but instead returns an object that may be used to call
set_bit() later.
The UnusedId type holds a exclusive reference to the IdPool, so it's
guaranteed that nobody else can call find_unused_id() while the UnusedId
object is live.
[Miguel: rust: id_pool: fix example]
Reviewed-by: Burak Emir <bqe@google.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_files.py')
0 files changed, 0 insertions, 0 deletions
