PatchworkOS  dbbdc99
A non-POSIX operating system.
Loading...
Searching...
No Matches
wait.c File Reference
#include <kernel/cpu/irq.h>
#include <kernel/mem/cache.h>
#include <kernel/sched/wait.h>
#include <kernel/cpu/cpu.h>
#include <kernel/cpu/ipi.h>
#include <kernel/log/log.h>
#include <kernel/log/panic.h>
#include <kernel/sched/clock.h>
#include <kernel/sched/sched.h>
#include <kernel/sched/thread.h>
#include <kernel/sched/timer.h>
#include <kernel/sync/lock.h>
#include <assert.h>
#include <errno.h>
#include <stdatomic.h>
#include <stdlib.h>
#include <sys/list.h>
Include dependency graph for wait.c:

Go to the source code of this file.

Functions

 PERCPU_DEFINE_CTOR (static wait_t, pcpu_wait)
 
static void wait_remove_wait_entries (thread_t *thread, errno_t err)
 
void wait_queue_init (wait_queue_t *queue)
 Initialize wait queue.
 
void wait_queue_deinit (wait_queue_t *queue)
 Deinitialize wait queue.
 
void wait_client_init (wait_client_t *client)
 Initialize a threads wait client.
 
void wait_check_timeouts (interrupt_frame_t *frame)
 Check for timeouts and unblock threads as needed.
 
uint64_t wait_block_prepare (wait_queue_t **waitQueues, uint64_t amount, clock_t timeout)
 Prepare to block the currently running thread.
 
void wait_block_cancel (void)
 Cancels blocking of the currently running thread.
 
uint64_t wait_block_commit (void)
 Block the currently running thread.
 
bool wait_block_finalize (interrupt_frame_t *frame, thread_t *thread, clock_t uptime)
 Finalize blocking of a thread.
 
void wait_unblock_thread (thread_t *thread, errno_t err)
 Unblock a specific thread.
 
uint64_t wait_unblock (wait_queue_t *queue, uint64_t amount, errno_t err)
 Unblock threads waiting on a wait queue.
 

Variables

static cache_t waitEntryCache
 

Function Documentation

◆ PERCPU_DEFINE_CTOR()

PERCPU_DEFINE_CTOR ( static  wait_t,
pcpu_wait   
)

Definition at line 24 of file wait.c.

Here is the call graph for this function:

◆ wait_remove_wait_entries()

static void wait_remove_wait_entries ( thread_t thread,
errno_t  err 
)
static

Definition at line 32 of file wait.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ waitEntryCache

cache_t waitEntryCache
static
Initial value:
=
#define CACHE_LINE
Cache line size in bytes.
Definition cache.h:75
#define CACHE_CREATE(_cache, _name, _size, _alignment, _ctor, _dtor)
Macro to create a cache initializer.
Definition cache.h:148
#define NULL
Pointer error value.
Definition NULL.h:25
Represents a thread waiting on a wait queue.
Definition wait.h:173
static cache_t waitEntryCache
Definition wait.c:21

Definition at line 21 of file wait.c.