Skip to content

Commit

Permalink
chore: update safety notice on keystore::Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
coriolinus committed Jan 29, 2025
1 parent d7206f5 commit 3d87ffa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion keystore/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ pub trait FetchFromDatabase: Send + Sync {
async fn count<E: Entity<ConnectionType = KeystoreDatabaseConnection>>(&self) -> CryptoKeystoreResult<usize>;
}

// * SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
// SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
unsafe impl Send for Connection {}
// SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
unsafe impl Sync for Connection {}

impl Connection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ pub struct Connection {
pub(crate) conn: Arc<Mutex<KeystoreDatabaseConnection>>,
}

// * SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
// SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
unsafe impl Send for Connection {}
// SAFETY: this has mutexes and atomics protecting underlying data so this is safe to share between threads
unsafe impl Sync for Connection {}

impl Connection {
Expand Down

0 comments on commit 3d87ffa

Please sign in to comment.