nativethread

Crates.ionativethread
lib.rsnativethread
version0.2.0
created_at2025-08-28 21:16:55.714989+00
updated_at2025-08-30 11:11:13.891695+00
descriptionNo-dependency library that provides native thread operations in a wide variety of platforms
homepagehttps://sr.ht/~yuce/nativethread
repositoryhttps://git.sr.ht/~yuce/nativethread-rs
max_upload_size
id1814681
size6,896
Yüce Tekol (yuce)

documentation

README

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
  • MacOS

Usage

Add the following in your Corgo.toml:

[dependencies]
nativethread = "0.2.0"

Getting the Thread Native ID

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

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

License

This crate is licensed under MIT.

Commit count: 0

cargo fmt