Thread synchronization

#import "std/sync"

Multiplatform implementation of various thread synchronization tools.

Todo

This module is experimental and not fully supported across all platforms.

std.Mutex

Mutex :: _sync_impl.Mutex

Mutex type.

File: sync.bl

std.mutex_init

mutex_init :: fn (mutex: *Mutex)  #inline

Initialize mutex. Call mutex_terminate when mutex is no longer needed.

File: sync.bl

std.mutex_terminate

mutex_terminate :: fn (mutex: *Mutex)  #inline

Terminate mutex.

File: sync.bl

std.mutex_lock

mutex_lock :: fn (mutex: *Mutex)  #inline

Lock mutex and enter critical section.

File: sync.bl

std.mutex_try_lock

mutex_try_lock :: fn (mutex: *Mutex) bool #inline

File: sync.bl

std.mutex_unlock

mutex_unlock :: fn (mutex: *Mutex)  #inline

Unlock previously locked mutex and leave critical section.

File: sync.bl