1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use std::ffi::c_void;

#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum AwsCThreadDetachState {
    NotCreated = 1,
    Joinable,
    JoinCompleted,
    Managed,
}

#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum AwsCThreadJoinStrategy {
    Manual = 0,
    Managed,
}

#[repr(C)]
pub struct AwsCThreadOptions {
    pub stack_size: usize,
    pub cpu_id: i32,
    pub join_strategy: AwsCThreadJoinStrategy,
}

pub union AwsCThreadOnce {
    pub ptr: *mut c_void,
}

#[cfg(windows)]
pub type AwsCThreadId = u64;

#[cfg(not(windows))]
pub type AwsCThreadId = libc::pthread_t;

// TODO: Add functions