PatchworkOS  69292a3
A non-POSIX operating system.
Loading...
Searching...
No Matches

Threading. More...

Collaboration diagram for Threading:

Detailed Description

Threading.

Todo:
Write threading documentation.
Todo:
Implement Thread Local Storage (TLS).

Data Structures

struct  _thread_t
 

Macros

#define _MTX_SPIN_COUNT   100
 
#define _THREADS_MAX   2048
 
#define _THREAD_ATTACHED   1
 
#define _THREAD_DETACHED   2
 
#define _THREAD_JOINING   3
 
#define _THREAD_EXITED   4
 
#define _THREAD_SELF   ((_thread_t __seg_fs*)0)
 

Typedefs

typedef struct _thread _thread_t
 
typedef void(* _thread_entry_t) (_thread_t *)
 

Functions

void _threading_init (void)
 
_thread_t_thread_new (thrd_start_t func, void *arg)
 
void _thread_free (_thread_t *thread)
 
_thread_t_thread_get (tid_t id)
 

Macro Definition Documentation

◆ _MTX_SPIN_COUNT

#define _MTX_SPIN_COUNT   100

Definition at line 21 of file threading.h.

◆ _THREADS_MAX

#define _THREADS_MAX   2048

Definition at line 23 of file threading.h.

◆ _THREAD_ATTACHED

#define _THREAD_ATTACHED   1

Definition at line 29 of file threading.h.

◆ _THREAD_DETACHED

#define _THREAD_DETACHED   2

Definition at line 30 of file threading.h.

◆ _THREAD_JOINING

#define _THREAD_JOINING   3

Definition at line 31 of file threading.h.

◆ _THREAD_EXITED

#define _THREAD_EXITED   4

Definition at line 32 of file threading.h.

◆ _THREAD_SELF

#define _THREAD_SELF   ((_thread_t __seg_fs*)0)

Definition at line 53 of file threading.h.

Typedef Documentation

◆ _thread_t

typedef struct _thread _thread_t

Definition at line 25 of file threading.h.

◆ _thread_entry_t

typedef void(* _thread_entry_t) (_thread_t *)

Definition at line 27 of file threading.h.

Function Documentation

◆ _threading_init()

void _threading_init ( void  )

Definition at line 63 of file threading.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _thread_new()

_thread_t * _thread_new ( thrd_start_t  func,
void *  arg 
)

Definition at line 86 of file threading.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _thread_free()

void _thread_free ( _thread_t thread)

Definition at line 121 of file threading.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _thread_get()

_thread_t * _thread_get ( tid_t  id)

Definition at line 130 of file threading.c.

Here is the caller graph for this function: