Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec8af0ef authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "rust: Mark DeathRecipient Send and Sync" am: 593991bf am: 3d3003b3...

Merge "rust: Mark DeathRecipient Send and Sync" am: 593991bf am: 3d3003b3 am: bf0155a0 am: a9b2fcd9

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2054944



Change-Id: I134fefc3a9edf00468c3a37d0262c1c00cb489f4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 76c5b21b a9b2fcd9
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -575,6 +575,20 @@ struct DeathRecipientVtable {
    cookie_decr_refcount: unsafe extern "C" fn(*mut c_void),
    cookie_decr_refcount: unsafe extern "C" fn(*mut c_void),
}
}


/// # Safety
///
/// A `DeathRecipient` is a wrapper around `AIBinder_DeathRecipient` and a pointer
/// to a `Fn` which is `Sync` and `Send` (the cookie field). As
/// `AIBinder_DeathRecipient` is threadsafe, this structure is too.
unsafe impl Send for DeathRecipient {}

/// # Safety
///
/// A `DeathRecipient` is a wrapper around `AIBinder_DeathRecipient` and a pointer
/// to a `Fn` which is `Sync` and `Send` (the cookie field). As
/// `AIBinder_DeathRecipient` is threadsafe, this structure is too.
unsafe impl Sync for DeathRecipient {}

impl DeathRecipient {
impl DeathRecipient {
    /// Create a new death recipient that will call the given callback when its
    /// Create a new death recipient that will call the given callback when its
    /// associated object dies.
    /// associated object dies.