62 panic(
NULL,
"Failed to create process reaper thread");
#define CONFIG_PROCESS_REAPER_INTERVAL
Process reaper interval configuration.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
void reaper_push(process_t *process)
Pushes a process to be reaped later.
void reaper_init(void)
Initializes the process reaper.
static uint64_t process_rcu_thread_count(process_t *process)
Gets the amount of threads in a process.
void process_remove(process_t *process)
Removes a process from the system.
clock_t clock_uptime(void)
Retrieve the time in nanoseconds since boot.
tid_t thread_kernel_create(thread_kernel_entry_t entry, void *arg)
Creates a new thread that runs in kernel mode and submits it to the scheduler.
uint64_t sched_nanosleep(clock_t timeout)
Sleeps the current thread for a specified duration in nanoseconds.
#define LOCK_CREATE()
Create a lock initializer.
static void lock_release(lock_t *lock)
Releases a lock.
static void lock_acquire(lock_t *lock)
Acquires a lock, blocking until it is available.
#define RCU_READ_SCOPE()
RCU read-side critical section for the current scope.
#define REF(ptr)
Increment reference count.
#define UNREF(ptr)
Decrement reference count.
#define UNUSED(x)
Mark a variable as unused.
static void list_push_back(list_t *list, list_entry_t *entry)
Pushes an entry to the end of the list.
#define LIST_CREATE(name)
Creates a list initializer.
static bool list_is_empty(list_t *list)
Checks if a list is empty.
static list_entry_t * list_pop_front(list_t *list)
Pops the first entry from the list.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define CONTAINER_OF(ptr, type, member)
Container of macro.
__UINT64_TYPE__ clock_t
A nanosecond time.
static clock_t nextReaperTime
static void reaper_thread(void *arg)
A simple ticket lock implementation.