package core:sync/chan

⌘K
Ctrl+K
or
/

    Types

    Chan ¶

    Chan :: struct($T: typeid, $D: Direction = Direction.Both) {}
    Related Procedures With Parameters

    Direction ¶

    Direction :: enum int {
    	Send = -1, 
    	Both = 0, 
    	Recv = 1, 
    }

    Raw_Chan ¶

    Raw_Chan :: struct {
    	// Shared
    	allocator:       runtime.Allocator,
    	allocation_size: int,
    	msg_size:        u16,
    	closed:          b16,
    	// guarded by `mutex`
    	mutex:           sync.Mutex,
    	r_cond:          sync.Cond,
    	w_cond:          sync.Cond,
    	r_waiting:       int,
    	// guarded by `mutex`
    	w_waiting:       int,
    	// Buffered
    	queue:           ^Raw_Queue,
    	// Unbuffered
    	unbuffered_data: rawptr,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Raw_Queue ¶

    Raw_Queue :: struct {
    	data: [^]u8,
    	len:  int,
    	cap:  int,
    	next: int,
    	size: int,
    }
    Related Procedures With Parameters

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    as_recv ¶

    as_recv :: proc "contextless" (c: $C/Chan($T, $D)) -> (r: Chan($T, $D=1)) {…}

    as_send ¶

    as_send :: proc "contextless" (c: $C/Chan($T, $D)) -> (s: Chan($T, $D=-1)) {…}

    can_recv ¶

    can_recv :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    can_send ¶

    can_send :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    cap ¶

    cap :: proc "contextless" (c: ^Raw_Chan) -> int {…}

    close ¶

    close :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    create_buffered ¶

    create_buffered :: proc($C: typeid/Chan($T, $D=0), #any_int cap: int, allocator: runtime.Allocator) -> (c: $/Chan($T, $D=0), err: runtime.Allocator_Error) {…}

    create_raw_buffered ¶

    create_raw_buffered :: proc(#any_int msg_size, #any_int msg_alignment: int, #any_int cap: int, allocator: runtime.Allocator) -> (c: ^Raw_Chan, err: runtime.Allocator_Error) {…}

    create_raw_unbuffered ¶

    create_raw_unbuffered :: proc(#any_int msg_size, #any_int msg_alignment: int, allocator: runtime.Allocator) -> (c: ^Raw_Chan, err: runtime.Allocator_Error) {…}

    create_unbuffered ¶

    create_unbuffered :: proc($C: typeid/Chan($T, $D=0), allocator: runtime.Allocator) -> (c: $/Chan($T, $D=0), err: runtime.Allocator_Error) {…}

    destroy ¶

    destroy :: proc(c: ^Raw_Chan) -> (err: runtime.Allocator_Error) {…}

    is_buffered ¶

    is_buffered :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    is_closed ¶

    is_closed :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    is_unbuffered ¶

    is_unbuffered :: proc "contextless" (c: ^Raw_Chan) -> bool {…}

    len ¶

    len :: proc "contextless" (c: ^Raw_Chan) -> int {…}

    raw_queue_init ¶

    raw_queue_init :: proc "contextless" (q: ^Raw_Queue, data: rawptr, cap: int, size: int) {…}

    raw_queue_pop ¶

    raw_queue_pop :: proc "contextless" (q: ^Raw_Queue) -> (data: rawptr) {…}

    raw_queue_push ¶

    raw_queue_push :: proc "contextless" (q: ^Raw_Queue, data: rawptr) -> bool {…}

    recv ¶

    recv :: proc "contextless" (c: $C/Chan($T, $D=0)) -> (data: $T, ok: bool) {…}

    recv_raw ¶

    recv_raw :: proc "contextless" (c: ^Raw_Chan, msg_out: rawptr) -> (ok: bool) {…}

    select_raw ¶

    select_raw :: proc(recvs: []^Raw_Chan, sends: []^Raw_Chan, send_msgs: []rawptr, recv_out: rawptr) -> (select_idx: int, ok: bool) {…}

    send ¶

    send :: proc "contextless" (c: $C/Chan($T, $D), data: $T) -> (ok: bool) {…}

    send_raw ¶

    send_raw :: proc "contextless" (c: ^Raw_Chan, msg_in: rawptr) -> (ok: bool) {…}

    try_recv ¶

    try_recv :: proc "contextless" (c: $C/Chan($T, $D=0)) -> (data: $T, ok: bool) {…}

    try_recv_raw ¶

    try_recv_raw :: proc "contextless" (c: ^Raw_Chan, msg_out: rawptr) -> bool {…}

    try_send ¶

    try_send :: proc "contextless" (c: $C/Chan($T, $D), data: $T) -> (ok: bool) {…}

    try_send_raw ¶

    try_send_raw :: proc "contextless" (c: ^Raw_Chan, msg_in: rawptr) -> (ok: bool) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-06 21:12:12.710752800 +0000 UTC