nativethread 0.1.1

No-dependency library that provides native thread operations in a wide variety of platforms
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 5.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.03 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yuce

nativethread

This Rust crate provides native thread functions for a wide variety of platforms. It is a self-contained crate, with no dependencies. The following platforms are supported:

  • Linux
  • OpenBSD
  • FreeBSD
  • NetBSD
  • Illumos
  • Solaris
  • Haiku

More will be a added soon.

Usage

Add the following in your Corgo.toml:

[dependencies]
nativethread = "0.1.1"

Getting the Thread Native ID

Just call nativethread::get_id(), which returns the native thread ID as i32:

fn main() {
    let tid = nativethread::get_id();
    println!("native thread ID: {tid}");
}

License

This crate is licensed under MIT.