[][src]Struct sunrise_libuser::threads::Thread

pub struct Thread(ManuallyDrop<Box<ThreadContext>>);

Libuser's representation of a thread.

This is the low-level representation of a thread, kind to pthread_t on Unix.

You can create and start a thread from its Thread structure.

A Thread detaches (read "leak resources of") the associated thread when it is dropped, which means that there is no longer any handle to thread and no way to join on it.

Internally owns the ThreadContext for this thread, including its stack.

Implementations

impl Thread[src]

pub fn start(&self) -> Result<(), Error>[src]

Start this thread.

pub fn join(&self) -> Result<(), Error>[src]

Wait for the thread to exit.

pub fn create(
    entry: fn(_: usize),
    arg: usize,
    stack_size: usize
) -> Result<Self, Error>
[src]

Allocates resources for a thread. To start it, call start.

Allocates the stack, sets up the context and TLS, and calls svcCreateThread.

pub fn as_thread_ref(&self) -> &ThreadHandle[src]

Get the underlying thread handle.

Trait Implementations

impl Debug for Thread[src]

impl Drop for Thread[src]

Auto Trait Implementations

impl !RefUnwindSafe for Thread

impl Send for Thread

impl Sync for Thread

impl Unpin for Thread

impl UnwindSafe for Thread

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.