mountpoint_s3_crt/common/thread.rs
1//! Utilities for managing threads
2
3use mountpoint_s3_crt_sys::aws_thread_id_t;
4
5/// Identifier for a running thread
6///
7/// This is an opaque object that identifies a thread (like [std::thread::ThreadId] but without the
8/// uniqueness guarantee). Its actual value cannot be accessed because the underlying representation
9/// varies across platforms, but it implements [Eq] and [Hash] for comparison purposes.
10#[derive(Debug, Clone, PartialEq, Eq, Hash)]
11pub struct ThreadId(aws_thread_id_t);
12
13impl From<aws_thread_id_t> for ThreadId {
14 fn from(value: aws_thread_id_t) -> Self {
15 Self(value)
16 }
17}