AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
kthread.h File Reference
#include <core/system.h>
#include <sys/proc.h>

Go to the source code of this file.

Functions

int kthread_create (const char *name, void(*fn)(void *), void *arg, struct thread **ref)
 Makes a kernel thread, and makes it ready to run.

Variables

struct proc * kproc

Function Documentation

◆ kthread_create()

int kthread_create ( const char * name,
void(* fn )(void *),
void * arg,
struct thread ** ref )

Makes a kernel thread, and makes it ready to run.

Parameters
namethe thread's name, as ps shows it ("[net]")
fnthe function it runs, which must never return
argthe argument fn is called with
refif not NULL, set to the new thread
Returns
0, or -ENOMEM if there was no memory for the thread

Definition at line 71 of file kthread.c.

References thread::arch, arch_kthread_create(), thread::karg, thread::kentry, kfree(), kproc, kproc_init(), kthread_create(), kthread_start(), thread::name, NULL, RUNNABLE, sched_thread_ready(), thread::spawned, thread::state, thread_new(), and proc::threads.

Referenced by kthread_create(), and netif_register().

Variable Documentation

◆ kproc

struct proc* kproc
extern

Definition at line 23 of file kthread.c.

Referenced by kproc_init(), kthread_create(), signal_interrupts(), signal_send(), and signal_to().