Skip to content

Commit

Permalink
Merge #74
Browse files Browse the repository at this point in the history
74: NvList type is Send r=jmesmon a=ahrens

The NvList type can be safely sent to other threads.  Mark it as such by
implementing `Send`.

This is needed to use NvList's with async rust.  Let me know if I've misunderstood the semantics of `Send`.  It seems perfectly safe to operate on a `nvlist_t*` from a different thread, as long as it's only manipulated by one thread at a time.

Co-authored-by: Matthew Ahrens <[email protected]>
  • Loading branch information
bors[bot] and ahrens committed Oct 16, 2021
2 parents 42bbed3 + 6e7ddfa commit 212b0e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvpair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl NvEncoding {

foreign_type! {
/// An `NvList`
pub unsafe type NvList {
pub unsafe type NvList: Send {
type CType = sys::nvlist;
fn drop = sys::nvlist_free;
}
Expand Down

0 comments on commit 212b0e5

Please sign in to comment.