MOS Source Code
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6
7#define THREAD_MAGIC_THRD MOS_FOURCC('T', 'H', 'R', 'D')
8
9typedef struct _hashmap hashmap_t;
10
12
14{
15 return thread && thread->magic == THREAD_MAGIC_THRD;
16}
17
19void thread_destroy(thread_t *thread);
20
21thread_t *thread_new(process_t *owner, thread_mode mode, const char *name, size_t stack_size, void *stack);
25
26[[noreturn]] void thread_exit(thread_t *t);
27[[noreturn]] void thread_exit_locked(thread_t *t);
thread_mode
Definition task_types.h:20
void define_syscall thread_exit(void)
Definition ksyscall.c:170
#define should_inline
Definition mos_global.h:37
const char * name
Definition slab.c:31
u32 magic
Definition task_types.h:76
void thread_destroy(thread_t *thread)
Definition thread.c:46
#define THREAD_MAGIC_THRD
Definition thread.h:7
hashmap_t thread_table
Definition thread.c:23
thread_t * thread_get(tid_t id)
Definition thread.c:166
bool thread_wait_for_tid(tid_t tid)
Definition thread.c:175
should_inline bool thread_is_valid(const thread_t *thread)
Definition thread.h:13
thread_t * thread_allocate(process_t *owner, thread_mode tflags)
Definition thread.c:31
void thread_exit_locked(thread_t *t)
Definition thread.c:203
thread_t * thread_complete_init(thread_t *thread)
Definition thread.c:156
thread_t * thread_new(process_t *owner, thread_mode mode, const char *name, size_t stack_size, void *stack)
Definition thread.c:77
s32 tid_t
Definition types.h:79