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

Go to the source code of this file.

Functions

static tid_t new_thread_id (void)
 
thread_tthread_allocate (process_t *owner, thread_mode tflags)
 
void thread_destroy (thread_t *thread)
 
thread_tthread_new (process_t *owner, thread_mode tmode, const char *name, size_t stack_size, void *explicit_stack_top)
 
thread_tthread_complete_init (thread_t *thread)
 
thread_tthread_get (tid_t tid)
 
bool thread_wait_for_tid (tid_t tid)
 
void thread_exit (thread_t *t)
 
void thread_exit_locked (thread_t *t)
 

Variables

hashmap_t thread_table = { 0 }
 

Function Documentation

◆ new_thread_id()

static tid_t new_thread_id ( void )
static

Definition at line 25 of file thread.c.

Referenced by thread_allocate().

◆ thread_allocate()

thread_t * thread_allocate ( process_t * owner,
thread_mode tflags )

Definition at line 31 of file thread.c.

Referenced by process_do_fork(), and thread_new().

+ Here is the call graph for this function:

◆ thread_destroy()

void thread_destroy ( thread_t * thread)

Definition at line 46 of file thread.c.

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

+ Here is the call graph for this function:

◆ thread_new()

thread_t * thread_new ( process_t * owner,
thread_mode tmode,
const char * name,
size_t stack_size,
void * explicit_stack_top )

Definition at line 77 of file thread.c.

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

+ Here is the call graph for this function:

◆ thread_complete_init()

thread_t * thread_complete_init ( thread_t * thread)

Definition at line 156 of file thread.c.

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_t * thread_get ( tid_t tid)

Definition at line 166 of file thread.c.

Referenced by console_putc(), MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), MOS_STATIC_ASSERT(), 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 175 of file thread.c.

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 * t)

Definition at line 196 of file thread.c.

+ Here is the call graph for this function:

◆ thread_exit_locked()

void thread_exit_locked ( thread_t * t)

Definition at line 203 of file thread.c.

Referenced by process_exit(), and thread_exit().

+ Here is the call graph for this function:

Variable Documentation

◆ thread_table

hashmap_t thread_table = { 0 }