PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
thread.h File Reference
#include <errno.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <sys/proc.h>
#include <threads.h>
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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
 

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 9 of file thread.h.

◆ _THREADS_MAX

#define _THREADS_MAX   2048

Definition at line 11 of file thread.h.

◆ _THREAD_ATTACHED

#define _THREAD_ATTACHED   1

Definition at line 17 of file thread.h.

◆ _THREAD_DETACHED

#define _THREAD_DETACHED   2

Definition at line 18 of file thread.h.

◆ _THREAD_JOINING

#define _THREAD_JOINING   3

Definition at line 19 of file thread.h.

◆ _THREAD_EXITED

#define _THREAD_EXITED   4

Definition at line 20 of file thread.h.

Typedef Documentation

◆ _thread_t

typedef struct _thread _thread_t

Definition at line 13 of file thread.h.

◆ _thread_entry_t

typedef void(* _thread_entry_t) (_thread_t *)

Definition at line 15 of file thread.h.

Function Documentation

◆ _threading_init()

void _threading_init ( void  )

Definition at line 62 of file thread.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 85 of file thread.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 120 of file thread.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 129 of file thread.c.

Here is the caller graph for this function: