Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adrop

Simple and fast dedicated thread drop.

Latest version Documentation License

Getting Started

Add the following dependency to your Cargo manifest...

[dependencies]
adrop = "0.2"

Example

extern crate adrop;

use adrop::*;

struct Test {}

impl Drop for Test {
    fn drop(&mut self) {
        println!(
            "Dropping HasDrop! ThreadId: {:?}",
            std::thread::current().id()
        );
    }
}

fn main() {
    println!("Main ThreadId: {:?}", std::thread::current().id());
    adrop(Test {});
    // Output:
    // Main ThreadId: ThreadId(1)
    // Dropping HasDrop! ThreadId: ThreadId(2)
}

Or you can use Adrop wrapper to realize automatic adrop:

let _ = Adrop::new(Test {});

License

About

Simple and fast dedicated thread drop.

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages