Skip to content

Commit

Permalink
Add a test to check that RoTxn/RwTxn is Send
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Mar 6, 2025
1 parent 9dfa0e3 commit 3192e8f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions heed/src/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,24 @@ impl std::ops::DerefMut for RwTxn<'_> {
&mut self.txn
}
}

#[cfg(test)]
mod tests {
#[test]
fn ro_txns_are_send() {
use crate::{RoTxn, WithoutTls};

fn is_send<T: Send>() {}

is_send::<RoTxn<WithoutTls>>();
}

#[test]
fn rw_txns_are_send() {
use crate::RwTxn;

fn is_send<T: Send>() {}

is_send::<RwTxn>();
}
}

0 comments on commit 3192e8f

Please sign in to comment.