MOS Source Code
Loading...
Searching...
No Matches
thread.cpp File Reference
#include "mos/assert.hpp"
#include "mos/lib/sync/spinlock.hpp"
#include "mos/mm/mm.hpp"
#include <errno.h>
#include <limits.h>
#include <mos/lib/structures/hashmap.hpp>
#include <mos/lib/structures/hashmap_common.hpp>
#include <mos/lib/structures/list.hpp>
#include <mos/mm/cow.hpp>
#include <mos/mm/paging/paging.hpp>
#include <mos/platform/platform.hpp>
#include <mos/syslog/printk.hpp>
#include <mos/tasks/process.hpp>
#include <mos/tasks/schedule.hpp>
#include <mos/tasks/task_types.hpp>
#include <mos/tasks/thread.hpp>
#include <mos/tasks/wait.hpp>
#include <mos_stdlib.hpp>
#include <mos_string.hpp>
+ Include dependency graph for thread.cpp:

Go to the source code of this file.

Functions

static tid_t new_thread_id (void)
 
Threadthread_allocate (Process *owner, thread_mode tflags)
 
void thread_destroy (Thread *thread)
 
PtrResult< Threadthread_new (Process *owner, thread_mode tmode, mos::string_view name, size_t stack_size, void *explicit_stack_top)
 
Threadthread_complete_init (Thread *thread)
 
Threadthread_get (tid_t tid)
 
bool thread_wait_for_tid (tid_t tid)
 
void thread_exit (Thread *&&t)
 
void thread_exit_locked (Thread *&&t)
 

Variables

mos::HashMap< tid_t, Thread * > thread_table
 

Function Documentation

◆ new_thread_id()

static tid_t new_thread_id ( void )
static

Definition at line 26 of file thread.cpp.

Referenced by thread_allocate().

◆ thread_allocate()

Thread * thread_allocate ( Process * owner,
thread_mode tflags )

Definition at line 37 of file thread.cpp.

Referenced by process_do_fork(), and thread_new().

+ Here is the call graph for this function:

◆ thread_destroy()

void thread_destroy ( Thread * thread)

Definition at line 52 of file thread.cpp.

Referenced by process_destroy(), process_do_execveat(), process_exit(), and thread_new().

+ Here is the call graph for this function:

◆ thread_new()

PtrResult< Thread > thread_new ( Process * owner,
thread_mode tmode,
mos::string_view name,
size_t stack_size,
void * explicit_stack_top )

Definition at line 77 of file thread.cpp.

Referenced by create_thread(), kthread_create_no_sched(), and process_new().

+ Here is the call graph for this function:

◆ thread_complete_init()

Thread * thread_complete_init ( Thread * thread)

Definition at line 165 of file thread.cpp.

Referenced by create_thread(), elf_create_process(), kthread_create_no_sched(), and process_do_fork().

+ Here is the call graph for this function:

◆ thread_get()

Thread * thread_get ( tid_t tid)

Definition at line 174 of file thread.cpp.

Referenced by MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), Console::putc(), thread_wait_for_tid(), and waitlist_wake().

+ Here is the call graph for this function:

◆ thread_wait_for_tid()

bool thread_wait_for_tid ( tid_t tid)

Definition at line 189 of file thread.cpp.

Referenced by MOS_STATIC_ASSERT(), process_do_execveat(), and process_exit().

+ Here is the call graph for this function:

◆ thread_exit()

void thread_exit ( Thread *&& t)

Definition at line 210 of file thread.cpp.

Referenced by MOS_STATIC_ASSERT().

+ Here is the call graph for this function:

◆ thread_exit_locked()

void thread_exit_locked ( Thread *&& t)

Definition at line 217 of file thread.cpp.

Referenced by process_exit(), and thread_exit().

+ Here is the call graph for this function:

Variable Documentation

◆ thread_table