MOS Source Code
Loading...
Searching...
No Matches
futex.c File Reference
#include "mos/platform/platform_defs.h"
#include <mos/lib/structures/list.h>
#include <mos/lib/sync/spinlock.h>
#include <mos/locks/futex.h>
#include <mos/mm/paging/paging.h>
#include <mos/platform/platform.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/schedule.h>
#include <mos/tasks/wait.h>
#include <mos/types.h>
#include <mos_stdlib.h>
+ Include dependency graph for futex.c:

Go to the source code of this file.

Classes

struct  futex_private_t
 

Typedefs

typedef ptr_t futex_key_t
 

Functions

static futex_key_t futex_get_key (const futex_word_t *futex)
 
bool futex_wait (futex_word_t *futex, futex_word_t expected)
 
bool futex_wake (futex_word_t *futex, size_t num_to_wake)
 

Variables

static list_head futex_list_head = LIST_HEAD_INIT(futex_list_head)
 
static spinlock_t futex_list_lock = SPINLOCK_INIT
 

Typedef Documentation

◆ futex_key_t

typedef ptr_t futex_key_t

Definition at line 16 of file futex.c.

Function Documentation

◆ futex_get_key()

static futex_key_t futex_get_key ( const futex_word_t * futex)
static

Definition at line 28 of file futex.c.

Referenced by futex_wait(), and futex_wake().

+ Here is the call graph for this function:

◆ futex_wait()

bool futex_wait ( futex_word_t * futex,
futex_word_t expected )

Definition at line 36 of file futex.c.

+ Here is the call graph for this function:

◆ futex_wake()

bool futex_wake ( futex_word_t * futex,
size_t num_to_wake )

Definition at line 100 of file futex.c.

+ Here is the call graph for this function:

Variable Documentation

◆ futex_list_head

list_head futex_list_head = LIST_HEAD_INIT(futex_list_head)
static

Definition at line 25 of file futex.c.

Referenced by futex_wait(), and futex_wake().

◆ futex_list_lock

spinlock_t futex_list_lock = SPINLOCK_INIT
static

Definition at line 26 of file futex.c.

Referenced by futex_wait(), and futex_wake().