use std::{iter, mem};
use crate::{Errno, kernel::errno};
pub mod signal;
pub mod timer;
pub mod affinity;
mod attrs;
mod handle;
pub mod raw;
pub use attrs::Attrs;
pub use handle::Handle;
pub const STACK_MIN: usize = libc::PTHREAD_STACK_MIN;
pub trait Thread: errno::Source {
type Cpus: DoubleEndedIterator<Item = affinity::raw::Cpu>
+ ExactSizeIterator
+ iter::FusedIterator;
type Timer: crate::Timer;
type Receiver: signal::raw::Receiver;
fn current() -> Result<Self::Cpus, affinity::Error>;
fn bind(cpu: affinity::raw::Cpu) -> Result<(), affinity::Error>;
fn is_main() -> bool;
fn try_crc32() -> Result<bool, Errno> {
raw::try_crc32(Self::read)
}
fn entropy<const N: usize>(
bytes: &mut mem::MaybeUninit<[u8; N]>,
) -> Result<&mut [u8; N], Errno> {
raw::entropy::<Self, N>(bytes)
}
}