XU XUv0.16.0

#core/sync

import: #core/sync

counts: 18 functions, 82 methods, 24 types, 8 constants, 0 method sets

Standard library package `#core/sync`.

const ORDER_RELAXED

XuAPI
pub const ORDER_RELAXED = 0

Purpose

Memory ordering constants for barriers and explicit atomic operations

const ORDER_ACQUIRE

XuAPI
pub const ORDER_ACQUIRE = 1

Purpose

Constant ORDER_ACQUIRE, defining protocol or algorithm parameters.

const ORDER_RELEASE

XuAPI
pub const ORDER_RELEASE = 2

Purpose

Constant ORDER_RELEASE, defining protocol or algorithm parameters.

const ORDER_ACQ_REL

XuAPI
pub const ORDER_ACQ_REL = 3

Purpose

Constant ORDER_ACQ_REL, defining protocol or algorithm parameters.

const ORDER_SEQ_CST

XuAPI
pub const ORDER_SEQ_CST = 4

Purpose

Constant ORDER_SEQ_CST, defining protocol or algorithm parameters.

const ONCE_UNINIT

XuAPI
pub const ONCE_UNINIT = 0

Purpose

Constant ONCE_UNINIT, defining protocol or algorithm parameters.

const ONCE_RUNNING

XuAPI
pub const ONCE_RUNNING = 1

Purpose

Constant ONCE_RUNNING, defining protocol or algorithm parameters.

const ONCE_DONE

XuAPI
pub const ONCE_DONE = 2

Purpose

Constant ONCE_DONE, defining protocol or algorithm parameters.

compiler_fence

XuAPI
pub fn compiler_fence()

Purpose

Compiler fence.

Parameters

No arguments are required.

Returns

This call does not return a value.

fence

XuAPI
pub fn fence(order int)

Purpose

Execute fence.

Parameters

order int
order (int)

Returns

This call does not return a value.

struct Spinlock

XuAPI
pub struct Spinlock {

}

Purpose

Spinlock context or state structure.

Public fields

This type has no public fields.

spinlock_new

XuAPI
pub fn spinlock_new() Spinlock

Purpose

Spinlock new.

Parameters

No arguments are required.

Returns

Spinlock — a value of this type

($&Spinlock) try_lock

XuAPI
pub fn (s $&Spinlock) try_lock() bool

Purpose

Operation on $&Spinlock: try lock.

Parameters

s $&Spinlock
The Spinlock instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Spinlock) lock

XuAPI
pub fn (s $&Spinlock) lock()

Purpose

Operation on $&Spinlock: acquire the lock.

Parameters

s $&Spinlock
The Spinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Spinlock) unlock

XuAPI
pub fn (s $&Spinlock) unlock()

Purpose

Operation on $&Spinlock: release the lock.

Parameters

s $&Spinlock
The Spinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct SpinGuard

XuAPI
pub struct SpinGuard {
    pub lock *raw Spinlock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw Spinlock
field (*raw Spinlock)

($&SpinGuard) drop

XuAPI
pub fn (g $&SpinGuard) drop()

Purpose

Execute drop on $&SpinGuard.

Parameters

g $&SpinGuard
The SpinGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Spinlock) acquire

XuAPI
pub fn (s $&Spinlock) acquire() SpinGuard

Purpose

Execute acquire on $&Spinlock.

Parameters

s $&Spinlock
The Spinlock instance used by this call (exclusive borrow).

Returns

SpinGuard — a value of this type

struct IrqSpinlock

XuAPI
pub struct IrqSpinlock {
    pub lock Spinlock
    pub depth u32
    pub saved u64
}

Purpose

Structure encapsulating lock, depth, saved.

Public fields

lock Spinlock
field (Spinlock)
depth u32
field (u32)
saved u64
field (u64)

irq_spinlock_new

XuAPI
pub fn irq_spinlock_new() IrqSpinlock

Purpose

Irq spinlock new.

Parameters

No arguments are required.

Returns

IrqSpinlock — a value of this type

($&IrqSpinlock) lock

XuAPI
pub fn (s $&IrqSpinlock) lock()

Purpose

Operation on $&IrqSpinlock: acquire the lock.

Parameters

s $&IrqSpinlock
The IrqSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&IrqSpinlock) unlock

XuAPI
pub fn (s $&IrqSpinlock) unlock()

Purpose

Operation on $&IrqSpinlock: release the lock.

Parameters

s $&IrqSpinlock
The IrqSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct IrqGuard

XuAPI
pub struct IrqGuard {
    pub lock *raw IrqSpinlock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw IrqSpinlock
field (*raw IrqSpinlock)

($&IrqGuard) drop

XuAPI
pub fn (g $&IrqGuard) drop()

Purpose

Execute drop on $&IrqGuard.

Parameters

g $&IrqGuard
The IrqGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&IrqSpinlock) acquire

XuAPI
pub fn (s $&IrqSpinlock) acquire() IrqGuard

Purpose

Execute acquire on $&IrqSpinlock.

Parameters

s $&IrqSpinlock
The IrqSpinlock instance used by this call (exclusive borrow).

Returns

IrqGuard — a value of this type

struct AtomicBool

XuAPI
pub struct AtomicBool {

}

Purpose

AtomicBool context or state structure.

Public fields

This type has no public fields.

atomic_bool_new

XuAPI
pub fn atomic_bool_new(v bool) AtomicBool

Purpose

Atomic bool new.

Parameters

v bool
value (bool)

Returns

AtomicBool — a value of this type

(&AtomicBool) load

XuAPI
pub fn (a &AtomicBool) load() bool

Purpose

Execute load on &AtomicBool.

Parameters

a &AtomicBool
The AtomicBool instance used by this call (borrow).

Returns

bool — true or false

($&AtomicBool) store

XuAPI
pub fn (a $&AtomicBool) store(v bool)

Purpose

Execute store on $&AtomicBool.

Parameters

a $&AtomicBool
The AtomicBool instance used by this call (exclusive borrow).
v bool
value (bool)

Returns

This call does not return a value.

($&AtomicBool) swap

XuAPI
pub fn (a $&AtomicBool) swap(v bool) bool

Purpose

Execute swap on $&AtomicBool.

Parameters

a $&AtomicBool
The AtomicBool instance used by this call (exclusive borrow).
v bool
value (bool)

Returns

bool — true or false

($&AtomicBool) compare_exchange

XuAPI
pub fn (a $&AtomicBool) compare_exchange(expected bool, desired bool) bool

Purpose

Operation on $&AtomicBool: compare exchange.

Parameters

a $&AtomicBool
The AtomicBool instance used by this call (exclusive borrow).
expected bool
expected (bool)
desired bool
desired (bool)

Returns

bool — true or false

struct AtomicU8

XuAPI
pub struct AtomicU8 {

}

Purpose

AtomicU8 context or state structure.

Public fields

This type has no public fields.

atomic_u8_new

XuAPI
pub fn atomic_u8_new(v u8) AtomicU8

Purpose

Atomic u8 new.

Parameters

v u8
value (u8)

Returns

AtomicU8 — a value of this type

(&AtomicU8) load

XuAPI
pub fn (a &AtomicU8) load() u8

Purpose

Execute load on &AtomicU8.

Parameters

a &AtomicU8
The AtomicU8 instance used by this call (borrow).

Returns

u8 — a value of this type

($&AtomicU8) store

XuAPI
pub fn (a $&AtomicU8) store(v u8)

Purpose

Execute store on $&AtomicU8.

Parameters

a $&AtomicU8
The AtomicU8 instance used by this call (exclusive borrow).
v u8
value (u8)

Returns

This call does not return a value.

($&AtomicU8) swap

XuAPI
pub fn (a $&AtomicU8) swap(v u8) u8

Purpose

Execute swap on $&AtomicU8.

Parameters

a $&AtomicU8
The AtomicU8 instance used by this call (exclusive borrow).
v u8
value (u8)

Returns

u8 — a value of this type

($&AtomicU8) compare_exchange

XuAPI
pub fn (a $&AtomicU8) compare_exchange(expected u8, desired u8) u8

Purpose

Operation on $&AtomicU8: compare exchange.

Parameters

a $&AtomicU8
The AtomicU8 instance used by this call (exclusive borrow).
expected u8
expected (u8)
desired u8
desired (u8)

Returns

u8 — a value of this type

struct AtomicU16

XuAPI
pub struct AtomicU16 {

}

Purpose

AtomicU16 context or state structure.

Public fields

This type has no public fields.

atomic_u16_new

XuAPI
pub fn atomic_u16_new(v u16) AtomicU16

Purpose

Atomic u16 new.

Parameters

v u16
value (u16)

Returns

AtomicU16 — a value of this type

(&AtomicU16) load

XuAPI
pub fn (a &AtomicU16) load() u16

Purpose

Execute load on &AtomicU16.

Parameters

a &AtomicU16
The AtomicU16 instance used by this call (borrow).

Returns

u16 — a value of this type

($&AtomicU16) store

XuAPI
pub fn (a $&AtomicU16) store(v u16)

Purpose

Execute store on $&AtomicU16.

Parameters

a $&AtomicU16
The AtomicU16 instance used by this call (exclusive borrow).
v u16
value (u16)

Returns

This call does not return a value.

($&AtomicU16) swap

XuAPI
pub fn (a $&AtomicU16) swap(v u16) u16

Purpose

Execute swap on $&AtomicU16.

Parameters

a $&AtomicU16
The AtomicU16 instance used by this call (exclusive borrow).
v u16
value (u16)

Returns

u16 — a value of this type

($&AtomicU16) compare_exchange

XuAPI
pub fn (a $&AtomicU16) compare_exchange(expected u16, desired u16) u16

Purpose

Operation on $&AtomicU16: compare exchange.

Parameters

a $&AtomicU16
The AtomicU16 instance used by this call (exclusive borrow).
expected u16
expected (u16)
desired u16
desired (u16)

Returns

u16 — a value of this type

struct AtomicU32

XuAPI
pub struct AtomicU32 {

}

Purpose

AtomicU32 context or state structure.

Public fields

This type has no public fields.

atomic_u32_new

XuAPI
pub fn atomic_u32_new(v u32) AtomicU32

Purpose

Atomic u32 new.

Parameters

v u32
value (u32)

Returns

AtomicU32 — a value of this type

(&AtomicU32) load

XuAPI
pub fn (a &AtomicU32) load() u32

Purpose

Execute load on &AtomicU32.

Parameters

a &AtomicU32
The AtomicU32 instance used by this call (borrow).

Returns

u32 — a value of this type

(&AtomicU32) load_ordered

XuAPI
pub fn (a &AtomicU32) load_ordered(order int) u32

Purpose

Operation on &AtomicU32: load ordered.

Parameters

a &AtomicU32
The AtomicU32 instance used by this call (borrow).
order int
order (int)

Returns

u32 — a value of this type

($&AtomicU32) store

XuAPI
pub fn (a $&AtomicU32) store(v u32)

Purpose

Execute store on $&AtomicU32.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
v u32
value (u32)

Returns

This call does not return a value.

($&AtomicU32) store_ordered

XuAPI
pub fn (a $&AtomicU32) store_ordered(v u32, order int)

Purpose

Operation on $&AtomicU32: store ordered.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
v u32
value (u32)
order int
order (int)

Returns

This call does not return a value.

($&AtomicU32) swap

XuAPI
pub fn (a $&AtomicU32) swap(v u32) u32

Purpose

Execute swap on $&AtomicU32.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
v u32
value (u32)

Returns

u32 — a value of this type

($&AtomicU32) compare_exchange

XuAPI
pub fn (a $&AtomicU32) compare_exchange(expected u32, desired u32) u32

Purpose

Operation on $&AtomicU32: compare exchange.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
expected u32
expected (u32)
desired u32
desired (u32)

Returns

u32 — a value of this type

($&AtomicU32) fetch_add

XuAPI
pub fn (a $&AtomicU32) fetch_add(delta u32) u32

Purpose

Operation on $&AtomicU32: fetch add.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
delta u32
delta (u32)

Returns

u32 — a value of this type

($&AtomicU32) fetch_sub

XuAPI
pub fn (a $&AtomicU32) fetch_sub(delta u32) u32

Purpose

Operation on $&AtomicU32: fetch sub.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
delta u32
delta (u32)

Returns

u32 — a value of this type

($&AtomicU32) fetch_and

XuAPI
pub fn (a $&AtomicU32) fetch_and(mask u32) u32

Purpose

Operation on $&AtomicU32: fetch and.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
mask u32
mask (u32)

Returns

u32 — a value of this type

($&AtomicU32) fetch_or

XuAPI
pub fn (a $&AtomicU32) fetch_or(mask u32) u32

Purpose

Operation on $&AtomicU32: fetch or.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
mask u32
mask (u32)

Returns

u32 — a value of this type

($&AtomicU32) fetch_xor

XuAPI
pub fn (a $&AtomicU32) fetch_xor(mask u32) u32

Purpose

Operation on $&AtomicU32: fetch xor.

Parameters

a $&AtomicU32
The AtomicU32 instance used by this call (exclusive borrow).
mask u32
mask (u32)

Returns

u32 — a value of this type

struct AtomicU64

XuAPI
pub struct AtomicU64 {

}

Purpose

AtomicU64 context or state structure.

Public fields

This type has no public fields.

atomic_u64_new

XuAPI
pub fn atomic_u64_new(v u64) AtomicU64

Purpose

Atomic u64 new.

Parameters

v u64
value (u64)

Returns

AtomicU64 — a value of this type

(&AtomicU64) load

XuAPI
pub fn (a &AtomicU64) load() u64

Purpose

Execute load on &AtomicU64.

Parameters

a &AtomicU64
The AtomicU64 instance used by this call (borrow).

Returns

u64 — a value of this type

(&AtomicU64) load_ordered

XuAPI
pub fn (a &AtomicU64) load_ordered(order int) u64

Purpose

Operation on &AtomicU64: load ordered.

Parameters

a &AtomicU64
The AtomicU64 instance used by this call (borrow).
order int
order (int)

Returns

u64 — a value of this type

($&AtomicU64) store

XuAPI
pub fn (a $&AtomicU64) store(v u64)

Purpose

Execute store on $&AtomicU64.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
v u64
value (u64)

Returns

This call does not return a value.

($&AtomicU64) store_ordered

XuAPI
pub fn (a $&AtomicU64) store_ordered(v u64, order int)

Purpose

Operation on $&AtomicU64: store ordered.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
v u64
value (u64)
order int
order (int)

Returns

This call does not return a value.

($&AtomicU64) swap

XuAPI
pub fn (a $&AtomicU64) swap(v u64) u64

Purpose

Execute swap on $&AtomicU64.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
v u64
value (u64)

Returns

u64 — a value of this type

($&AtomicU64) compare_exchange

XuAPI
pub fn (a $&AtomicU64) compare_exchange(expected u64, desired u64) u64

Purpose

Operation on $&AtomicU64: compare exchange.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
expected u64
expected (u64)
desired u64
desired (u64)

Returns

u64 — a value of this type

($&AtomicU64) fetch_add

XuAPI
pub fn (a $&AtomicU64) fetch_add(delta u64) u64

Purpose

Operation on $&AtomicU64: fetch add.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
delta u64
delta (u64)

Returns

u64 — a value of this type

($&AtomicU64) fetch_sub

XuAPI
pub fn (a $&AtomicU64) fetch_sub(delta u64) u64

Purpose

Operation on $&AtomicU64: fetch sub.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
delta u64
delta (u64)

Returns

u64 — a value of this type

($&AtomicU64) fetch_and

XuAPI
pub fn (a $&AtomicU64) fetch_and(mask u64) u64

Purpose

Operation on $&AtomicU64: fetch and.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
mask u64
mask (u64)

Returns

u64 — a value of this type

($&AtomicU64) fetch_or

XuAPI
pub fn (a $&AtomicU64) fetch_or(mask u64) u64

Purpose

Operation on $&AtomicU64: fetch or.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
mask u64
mask (u64)

Returns

u64 — a value of this type

($&AtomicU64) fetch_xor

XuAPI
pub fn (a $&AtomicU64) fetch_xor(mask u64) u64

Purpose

Operation on $&AtomicU64: fetch xor.

Parameters

a $&AtomicU64
The AtomicU64 instance used by this call (exclusive borrow).
mask u64
mask (u64)

Returns

u64 — a value of this type

struct AtomicPtr

XuAPI
pub struct AtomicPtr {

}

Purpose

AtomicPtr context or state structure.

Public fields

This type has no public fields.

atomic_ptr_new

XuAPI
pub fn atomic_ptr_new(p *raw u8) AtomicPtr

Purpose

Atomic ptr new.

Parameters

p *raw u8
p (*raw u8)

Returns

AtomicPtr — a value of this type

(&AtomicPtr) load

XuAPI
pub fn (a &AtomicPtr) load() *raw u8

Purpose

Execute load on &AtomicPtr.

Parameters

a &AtomicPtr
The AtomicPtr instance used by this call (borrow).

Returns

*raw u8 — a value of this type

($&AtomicPtr) store

XuAPI
pub fn (a $&AtomicPtr) store(ptr *raw u8)

Purpose

Execute store on $&AtomicPtr.

Parameters

a $&AtomicPtr
The AtomicPtr instance used by this call (exclusive borrow).
ptr *raw u8
ptr (*raw u8)

Returns

This call does not return a value.

($&AtomicPtr) swap

XuAPI
pub fn (a $&AtomicPtr) swap(ptr *raw u8) *raw u8

Purpose

Execute swap on $&AtomicPtr.

Parameters

a $&AtomicPtr
The AtomicPtr instance used by this call (exclusive borrow).
ptr *raw u8
ptr (*raw u8)

Returns

*raw u8 — a value of this type

($&AtomicPtr) compare_exchange

XuAPI
pub fn (a $&AtomicPtr) compare_exchange(expected *raw u8, desired *raw u8) *raw u8

Purpose

Operation on $&AtomicPtr: compare exchange.

Parameters

a $&AtomicPtr
The AtomicPtr instance used by this call (exclusive borrow).
expected *raw u8
expected (*raw u8)
desired *raw u8
desired (*raw u8)

Returns

*raw u8 — a value of this type

struct RwSpinlock

XuAPI
pub struct RwSpinlock {

}

Purpose

RwSpinlock context or state structure.

Public fields

This type has no public fields.

rw_spinlock_new

XuAPI
pub fn rw_spinlock_new() RwSpinlock

Purpose

Rw spinlock new.

Parameters

No arguments are required.

Returns

RwSpinlock — a value of this type

($&RwSpinlock) read_lock

XuAPI
pub fn (rw $&RwSpinlock) read_lock()

Purpose

Operation on $&RwSpinlock: acquire a shared read lock.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RwSpinlock) read_unlock

XuAPI
pub fn (rw $&RwSpinlock) read_unlock()

Purpose

Operation on $&RwSpinlock: release a read lock.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RwSpinlock) write_lock

XuAPI
pub fn (rw $&RwSpinlock) write_lock()

Purpose

Operation on $&RwSpinlock: acquire an exclusive write lock.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RwSpinlock) write_unlock

XuAPI
pub fn (rw $&RwSpinlock) write_unlock()

Purpose

Operation on $&RwSpinlock: release a write lock.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct RwReadGuard

XuAPI
pub struct RwReadGuard {
    pub lock *raw RwSpinlock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw RwSpinlock
field (*raw RwSpinlock)

($&RwReadGuard) drop

XuAPI
pub fn (g $&RwReadGuard) drop()

Purpose

Execute drop on $&RwReadGuard.

Parameters

g $&RwReadGuard
The RwReadGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RwSpinlock) read

XuAPI
pub fn (rw $&RwSpinlock) read() RwReadGuard

Purpose

Operation on $&RwSpinlock: read up to max bytes.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

RwReadGuard — a value of this type

struct RwWriteGuard

XuAPI
pub struct RwWriteGuard {
    pub lock *raw RwSpinlock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw RwSpinlock
field (*raw RwSpinlock)

($&RwWriteGuard) drop

XuAPI
pub fn (g $&RwWriteGuard) drop()

Purpose

Execute drop on $&RwWriteGuard.

Parameters

g $&RwWriteGuard
The RwWriteGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RwSpinlock) write

XuAPI
pub fn (rw $&RwSpinlock) write() RwWriteGuard

Purpose

Operation on $&RwSpinlock: write data and return the byte count.

Parameters

rw $&RwSpinlock
The RwSpinlock instance used by this call (exclusive borrow).

Returns

RwWriteGuard — a value of this type

struct SeqLock

XuAPI
pub struct SeqLock {

}

Purpose

SeqLock context or state structure.

Public fields

This type has no public fields.

seqlock_new

XuAPI
pub fn seqlock_new() SeqLock

Purpose

Seqlock new.

Parameters

No arguments are required.

Returns

SeqLock — a value of this type

($&SeqLock) write_begin

XuAPI
pub fn (sl $&SeqLock) write_begin()

Purpose

Operation on $&SeqLock: write begin.

Parameters

sl $&SeqLock
The SeqLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SeqLock) write_end

XuAPI
pub fn (sl $&SeqLock) write_end()

Purpose

Operation on $&SeqLock: write end.

Parameters

sl $&SeqLock
The SeqLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&SeqLock) read_begin

XuAPI
pub fn (sl &SeqLock) read_begin() u32

Purpose

Operation on &SeqLock: read begin.

Parameters

sl &SeqLock
The SeqLock instance used by this call (borrow).

Returns

u32 — a value of this type

(&SeqLock) read_retry

XuAPI
pub fn (sl &SeqLock) read_retry(start u32) bool

Purpose

Operation on &SeqLock: read retry.

Parameters

sl &SeqLock
The SeqLock instance used by this call (borrow).
start u32
start (u32)

Returns

bool — true or false

struct Once

XuAPI
pub struct Once {

}

Purpose

Once context or state structure.

Public fields

This type has no public fields.

once_new

XuAPI
pub fn once_new() Once

Purpose

Once new.

Parameters

No arguments are required.

Returns

Once — a value of this type

(&Once) is_completed

XuAPI
pub fn (o &Once) is_completed() bool

Purpose

Operation on &Once: whether it is completed.

Parameters

o &Once
The Once instance used by this call (borrow).

Returns

bool — true or false

($&Once) try_begin

XuAPI
pub fn (o $&Once) try_begin() bool

Purpose

Operation on $&Once: try begin.

Parameters

o $&Once
The Once instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Once) finish

XuAPI
pub fn (o $&Once) finish()

Purpose

Execute finish on $&Once.

Parameters

o $&Once
The Once instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct TicketLock

XuAPI
pub struct TicketLock {

}

Purpose

TicketLock context or state structure.

Public fields

This type has no public fields.

ticket_lock_new

XuAPI
pub fn ticket_lock_new() TicketLock

Purpose

Ticket lock new.

Parameters

No arguments are required.

Returns

TicketLock — a value of this type

($&TicketLock) lock

XuAPI
pub fn (tl $&TicketLock) lock()

Purpose

Operation on $&TicketLock: acquire the lock.

Parameters

tl $&TicketLock
The TicketLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TicketLock) try_lock

XuAPI
pub fn (tl $&TicketLock) try_lock() bool

Purpose

Operation on $&TicketLock: try lock.

Parameters

tl $&TicketLock
The TicketLock instance used by this call (exclusive borrow).

Returns

bool — true or false

($&TicketLock) unlock

XuAPI
pub fn (tl $&TicketLock) unlock()

Purpose

Operation on $&TicketLock: release the lock.

Parameters

tl $&TicketLock
The TicketLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct TicketGuard

XuAPI
pub struct TicketGuard {
    pub lock *raw TicketLock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw TicketLock
field (*raw TicketLock)

($&TicketGuard) drop

XuAPI
pub fn (g $&TicketGuard) drop()

Purpose

Execute drop on $&TicketGuard.

Parameters

g $&TicketGuard
The TicketGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TicketLock) acquire

XuAPI
pub fn (tl $&TicketLock) acquire() TicketGuard

Purpose

Execute acquire on $&TicketLock.

Parameters

tl $&TicketLock
The TicketLock instance used by this call (exclusive borrow).

Returns

TicketGuard — a value of this type

struct IrqTicketLock

XuAPI
pub struct IrqTicketLock {

}

Purpose

IrqTicketLock context or state structure.

Public fields

This type has no public fields.

irq_ticket_lock_new

XuAPI
pub fn irq_ticket_lock_new() IrqTicketLock

Purpose

Irq ticket lock new.

Parameters

No arguments are required.

Returns

IrqTicketLock — a value of this type

($&IrqTicketLock) lock

XuAPI
pub fn (tl $&IrqTicketLock) lock()

Purpose

Operation on $&IrqTicketLock: acquire the lock.

Parameters

tl $&IrqTicketLock
The IrqTicketLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&IrqTicketLock) unlock

XuAPI
pub fn (tl $&IrqTicketLock) unlock()

Purpose

Operation on $&IrqTicketLock: release the lock.

Parameters

tl $&IrqTicketLock
The IrqTicketLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct IrqTicketGuard

XuAPI
pub struct IrqTicketGuard {
    pub lock *raw IrqTicketLock
}

Purpose

Structure encapsulating lock.

Public fields

lock *raw IrqTicketLock
field (*raw IrqTicketLock)

($&IrqTicketGuard) drop

XuAPI
pub fn (g $&IrqTicketGuard) drop()

Purpose

Execute drop on $&IrqTicketGuard.

Parameters

g $&IrqTicketGuard
The IrqTicketGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&IrqTicketLock) acquire

XuAPI
pub fn (tl $&IrqTicketLock) acquire() IrqTicketGuard

Purpose

Execute acquire on $&IrqTicketLock.

Parameters

tl $&IrqTicketLock
The IrqTicketLock instance used by this call (exclusive borrow).

Returns

IrqTicketGuard — a value of this type

struct IrqRwSpinlock

XuAPI
pub struct IrqRwSpinlock {

}

Purpose

IrqRwSpinlock context or state structure.

Public fields

This type has no public fields.

irq_rw_spinlock_new

XuAPI
pub fn irq_rw_spinlock_new() IrqRwSpinlock

Purpose

Irq rw spinlock new.

Parameters

No arguments are required.

Returns

IrqRwSpinlock — a value of this type

struct IrqRwReadGuard

XuAPI
pub struct IrqRwReadGuard {
    pub lock *raw IrqRwSpinlock
    pub saved_flags u64
}

Purpose

Structure encapsulating lock, saved_flags.

Public fields

lock *raw IrqRwSpinlock
field (*raw IrqRwSpinlock)
saved_flags u64
field (u64)

($&IrqRwReadGuard) drop

XuAPI
pub fn (g $&IrqRwReadGuard) drop()

Purpose

Execute drop on $&IrqRwReadGuard.

Parameters

g $&IrqRwReadGuard
The IrqRwReadGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct IrqRwWriteGuard

XuAPI
pub struct IrqRwWriteGuard {
    pub lock *raw IrqRwSpinlock
    pub saved_flags u64
}

Purpose

Structure encapsulating lock, saved_flags.

Public fields

lock *raw IrqRwSpinlock
field (*raw IrqRwSpinlock)
saved_flags u64
field (u64)

($&IrqRwWriteGuard) drop

XuAPI
pub fn (g $&IrqRwWriteGuard) drop()

Purpose

Execute drop on $&IrqRwWriteGuard.

Parameters

g $&IrqRwWriteGuard
The IrqRwWriteGuard instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&IrqRwSpinlock) read

XuAPI
pub fn (rw $&IrqRwSpinlock) read() IrqRwReadGuard

Purpose

Operation on $&IrqRwSpinlock: read up to max bytes.

Parameters

rw $&IrqRwSpinlock
The IrqRwSpinlock instance used by this call (exclusive borrow).

Returns

IrqRwReadGuard — a value of this type

($&IrqRwSpinlock) write

XuAPI
pub fn (rw $&IrqRwSpinlock) write() IrqRwWriteGuard

Purpose

Operation on $&IrqRwSpinlock: write data and return the byte count.

Parameters

rw $&IrqRwSpinlock
The IrqRwSpinlock instance used by this call (exclusive borrow).

Returns

IrqRwWriteGuard — a value of this type

struct Barrier

XuAPI
pub struct Barrier {
    pub total u32
    pub arrived u32
    pub sense u32
    pub pad u32
}

Purpose

Structure encapsulating total, arrived, sense, pad.

Public fields

total u32
field (u32)
arrived u32
field (u32)
sense u32
field (u32)
pad u32
field (u32)

barrier_new

XuAPI
pub fn barrier_new(total u32) Barrier

Purpose

Barrier new.

Parameters

total u32
total (u32)

Returns

Barrier — a value of this type

($&Barrier) wait

XuAPI
pub fn (b $&Barrier) wait()

Purpose

Execute wait on $&Barrier.

Parameters

b $&Barrier
The Barrier instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SeqLock) write_lock

XuAPI
pub fn (sl $&SeqLock) write_lock()

Purpose

Operation on $&SeqLock: acquire an exclusive write lock.

Parameters

sl $&SeqLock
The SeqLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SeqLock) write_unlock

XuAPI
pub fn (sl $&SeqLock) write_unlock()

Purpose

Operation on $&SeqLock: release a write lock.

Parameters

sl $&SeqLock
The SeqLock instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct Semaphore

XuAPI
pub struct Semaphore {
    pub count AtomicU64
}

Purpose

Structure encapsulating count.

Public fields

count AtomicU64
field (AtomicU64)

semaphore_new

XuAPI
pub fn semaphore_new(initial u64) Semaphore

Purpose

Semaphore new.

Parameters

initial u64
initial (u64)

Returns

Semaphore — a value of this type

($&Semaphore) try_acquire

XuAPI
pub fn (s $&Semaphore) try_acquire() bool

Purpose

Operation on $&Semaphore: try acquire.

Parameters

s $&Semaphore
The Semaphore instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Semaphore) acquire

XuAPI
pub fn (s $&Semaphore) acquire()

Purpose

Execute acquire on $&Semaphore.

Parameters

s $&Semaphore
The Semaphore instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Semaphore) release

XuAPI
pub fn (s $&Semaphore) release()

Purpose

Execute release on $&Semaphore.

Parameters

s $&Semaphore
The Semaphore instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Semaphore) available

XuAPI
pub fn (s &Semaphore) available() u64

Purpose

Execute available on &Semaphore.

Parameters

s &Semaphore
The Semaphore instance used by this call (borrow).

Returns

u64 — a value of this type