|
PatchworkOS
|
#include <stdatomic.h>#include "_internal/config.h"#include "_internal/pid_t.h"#include "_internal/tid_t.h"#include "_internal/timespec.h"Go to the source code of this file.
Data Structures | |
| struct | cnd_t |
| struct | thrd_t |
| struct | tss_t |
| Task State Segment structure. More... | |
| struct | mtx_t |
Macros | |
| #define | ONCE_FLAG_INIT 0 |
| #define | TSS_DTOR_ITERATIONS 4 |
| #define | _MTX_UNLOCKED 0 |
| #define | _MTX_LOCKED 1 |
| #define | _MTX_CONTESTED 2 |
Typedefs | |
| typedef void(* | tss_dtor_t) (void *) |
| typedef int(* | thrd_start_t) (void *) |
| typedef int | once_flag |
Enumerations | |
| enum | { mtx_plain , mtx_recursive , mtx_timed } |
| enum | { thrd_timedout , thrd_success , thrd_busy , thrd_error , thrd_nomem } |
| anonymous enum |
| _PUBLIC int cnd_timedwait | ( | cnd_t *_RESTRICT | cond, |
| mtx_t *_RESTRICT | mtx, | ||
| const struct timespec *_RESTRICT | ts | ||
| ) |
Definition at line 10 of file mtx_destroy.c.
References mutex.
Referenced by _file_deinit(), and display_free().
Definition at line 10 of file mtx_init.c.
References _MTX_UNLOCKED, atomic_init, mtx_t::depth, ERR, mutex, mtx_t::owner, mtx_t::state, and thrd_success.
Referenced by _file_init(), _files_init(), _heap_init(), _threading_init(), and display_new().
Definition at line 11 of file mtx_lock.c.
References _MTX_CONTESTED, _MTX_LOCKED, _MTX_SPIN_COUNT, _MTX_UNLOCKED, atomic_compare_exchange_strong, CLOCKS_NEVER, mtx_t::depth, futex(), FUTEX_WAIT, gettid(), mutex, mtx_t::owner, mtx_t::state, and thrd_success.
Referenced by _files_close(), _files_flush(), _files_push(), _files_remove(), _heap_acquire(), _thread_free(), _thread_get(), _thread_new(), display_cmd_alloc(), display_cmds_flush(), display_disconnect(), display_dispatch(), display_dispatch_pending(), display_is_connected(), display_next(), display_push(), display_wait(), fclose(), fflush(), fgetc(), fgets(), font_default(), font_free(), font_new(), fputc(), fputs(), fread(), fseek(), ftell(), fwrite(), image_free(), image_new_blank(), puts(), ungetc(), vfprintf(), vfscanf(), window_free(), and window_new().
Definition at line 10 of file mtx_unlock.c.
References _MTX_CONTESTED, _MTX_UNLOCKED, atomic_exchange, CLOCKS_NEVER, mtx_t::depth, ERR, futex(), FUTEX_WAKE, gettid(), mutex, mtx_t::owner, mtx_t::state, thrd_error, and thrd_success.
Referenced by _files_close(), _files_flush(), _files_push(), _files_remove(), _heap_release(), _thread_free(), _thread_get(), _thread_new(), display_cmd_alloc(), display_cmds_flush(), display_disconnect(), display_dispatch(), display_dispatch_pending(), display_get_surface_info(), display_is_connected(), display_next(), display_push(), display_set_focus(), display_subscribe(), display_unsubscribe(), display_wait(), fclose(), fflush(), fgetc(), fgets(), font_default(), font_free(), font_new(), fputc(), fputs(), fread(), fseek(), ftell(), fwrite(), image_free(), image_new_blank(), puts(), ungetc(), vfprintf(), vfscanf(), window_free(), and window_new().
| _PUBLIC int thrd_create | ( | thrd_t * | thr, |
| thrd_start_t | func, | ||
| void * | arg | ||
| ) |
Definition at line 30 of file thrd_create.c.
References _thread_entry(), _thread_new(), _entry_ctx_t::arg, ERR, free(), _entry_ctx_t::func, thrd_t::id, _thread_t::id, klog, malloc(), NULL, openf(), thrd_error, and thrd_success.
Referenced by benchmark().
Definition at line 10 of file thrd_current.c.
References gettid(), and thrd_t::id.
Definition at line 10 of file thrd_detach.c.
References _THREAD_ATTACHED, _THREAD_DETACHED, _thread_get(), atomic_compare_exchange_strong, thrd_t::id, NULL, _thread_t::state, thrd_error, and thrd_success.
Definition at line 10 of file thrd_equal.c.
References thrd_t::id.
Definition at line 11 of file thrd_exit.c.
References _syscall_thread_exit(), _THREAD_DETACHED, _THREAD_EXITED, _thread_free(), _thread_get(), abort(), atomic_exchange, CLOCKS_NEVER, fprintf(), futex(), FUTEX_ALL, FUTEX_WAKE, gettid(), NULL, _thread_t::result, _thread_t::state, and stderr.
Referenced by _thread_entry().
Definition at line 10 of file thrd_join.c.
References _THREAD_ATTACHED, _THREAD_DETACHED, _THREAD_EXITED, _thread_free(), _thread_get(), _THREAD_JOINING, atomic_compare_exchange_strong, atomic_load, CLOCKS_NEVER, futex(), FUTEX_WAIT, thrd_t::id, NULL, _thread_t::result, _thread_t::state, thrd_error, and thrd_success.
Referenced by benchmark().
Definition at line 10 of file thrd_sleep.c.
References CLOCKS_PER_SEC, nanosleep(), NULL, start(), timespec::tv_nsec, timespec::tv_sec, and uptime().
| _PUBLIC void thrd_yield | ( | void | ) |
Definition at line 10 of file thrd_yield.c.
References _syscall_yield().
Referenced by start_services().
| _PUBLIC int tss_create | ( | tss_t * | key, |
| tss_dtor_t | dtor | ||
| ) |