79#define THREAD_FILES_HELD 4
void thread_files_release(struct thread *thread)
Lets go of the open files a thread's system call held, when the call returns or the thread is killed.
unsigned long long int uint64_t
An open file (POSIX's "open file description", fs/file.c).
A link in a list, inside the structure that is listed.
One wait queue that one polling thread waits for.
struct list_node run_link
it's on the ready list (sched.c) while it's ready to run, or on the wait queue it sleeps on (waitq); ...
int syscall_nr
the system call it's in (the last one it made), to restart it
struct list_node timer_link
it's on the timer's list while it waits with a deadline
int sig_oldmask_set
in sigsuspend() or pselect(): the signal mask they replaced, which the handler's frame keeps (sigretu...
void(*) kentry(void *arg)
int restarting
whether the call is a restart (a stop interrupted it, and no handler ran); restart_until is the deadl...
uint64_t sleep_until
when it waits with a deadline (sched_wait()): the deadline, in arch_rtime_ns() time
struct file * files[THREAD_FILES_HELD]
tid_t tid
the thread's ID, in its process
int killed
it was killed (proc_threads_end()) while it ran on another CPU: it frees itself there,...
uintptr_t stack
its user stack
struct poll_reg * poll_regs
in select() or poll(): what it waits for (poll_register()), and where it sleeps meanwhile
int urgent
it runs before the others once woken, as soon as the interrupt that woke it returns (sched_thread_wak...
int spawned
whether it has run yet
const char * name
A kernel thread's (process 0's): its name, and what it runs.
void * arch
the architecture's own data: its registers, its kernel stack
struct proc * owner
its process
uintptr_t fault_addr
the address of its last fault, the si_addr of the signal it raised
void * exit_value
what the thread exited with (thread_exit()), for thread_join()
int thread_kill(struct thread *thread)
Releases what a thread holds (its poll() registrations, its CPU state and kernel stack) and makes it ...
int thread_create(struct thread *thread, uintptr_t stack, uintptr_t entry, uintptr_t uentry, uintptr_t arg, uintptr_t attr, struct thread **new_thread)
Makes a new thread in the process of an existing one, for pthread_create().
int thread_new(struct proc *proc, struct thread **rthread)
Makes a new thread in a process.
#define THREAD_FILES_HELD
the open files its system call holds (file_hold()), let go of when the call returns,...