smp.h

Include dependency graph for smp.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stdbool.h" tooltip="stdbool.h"]
    "3" [label="stdatomic.h" tooltip="stdatomic.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/smp.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/smp.h" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include smp.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "6" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c"]
    "38" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c"]
    "5" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h"]
    "45" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h"]
    "44" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c"]
    "43" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h"]
    "24" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h"]
    "16" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c"]
    "39" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h"]
    "37" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c"]
    "49" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/synclist.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/synclist.h"]
    "36" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h"]
    "50" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/valueshashtable.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/valueshashtable.c"]
    "13" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c"]
    "31" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h"]
    "46" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h"]
    "3" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c"]
    "4" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h"]
    "29" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c"]
    "30" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h"]
    "48" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h"]
    "26" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c"]
    "25" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.h"]
    "17" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c"]
    "41" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h"]
    "32" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c"]
    "40" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.h"]
    "7" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.c"]
    "23" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h"]
    "35" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c"]
    "34" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h"]
    "22" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.c"]
    "42" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h"]
    "21" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c"]
    "20" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h"]
    "18" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/smp.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/smp.h" fillcolor="#BFBFBF"]
    "14" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h"]
    "27" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h"]
    "2" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/atomshashtable.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/atomshashtable.c"]
    "8" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c"]
    "28" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.h"]
    "9" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/opcodesswitch.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/opcodesswitch.h"]
    "11" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c"]
    "10" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.h"]
    "15" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.c"]
    "33" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.h"]
    "12" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/memory.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/memory.c"]
    "19" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c"]
    "47" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h"]
    "5" -> "6" [dir=back tooltip="include"]
    "5" -> "7" [dir=back tooltip="include"]
    "5" -> "8" [dir=back tooltip="include"]
    "5" -> "9" [dir=back tooltip="include"]
    "45" -> "6" [dir=back tooltip="include"]
    "45" -> "3" [dir=back tooltip="include"]
    "45" -> "38" [dir=back tooltip="include"]
    "45" -> "12" [dir=back tooltip="include"]
    "45" -> "8" [dir=back tooltip="include"]
    "45" -> "17" [dir=back tooltip="include"]
    "43" -> "44" [dir=back tooltip="include"]
    "43" -> "21" [dir=back tooltip="include"]
    "43" -> "9" [dir=back tooltip="include"]
    "24" -> "8" [dir=back tooltip="include"]
    "39" -> "15" [dir=back tooltip="include"]
    "39" -> "8" [dir=back tooltip="include"]
    "39" -> "16" [dir=back tooltip="include"]
    "49" -> "3" [dir=back tooltip="include"]
    "49" -> "15" [dir=back tooltip="include"]
    "49" -> "33" [dir=back tooltip="include"]
    "49" -> "32" [dir=back tooltip="include"]
    "49" -> "8" [dir=back tooltip="include"]
    "36" -> "6" [dir=back tooltip="include"]
    "36" -> "37" [dir=back tooltip="include"]
    "36" -> "38" [dir=back tooltip="include"]
    "36" -> "15" [dir=back tooltip="include"]
    "36" -> "21" [dir=back tooltip="include"]
    "36" -> "8" [dir=back tooltip="include"]
    "36" -> "9" [dir=back tooltip="include"]
    "36" -> "29" [dir=back tooltip="include"]
    "36" -> "30" [dir=back tooltip="include"]
    "36" -> "16" [dir=back tooltip="include"]
    "36" -> "18" [dir=back tooltip="include"]
    "36" -> "26" [dir=back tooltip="include"]
    "31" -> "32" [dir=back tooltip="include"]
    "31" -> "8" [dir=back tooltip="include"]
    "31" -> "9" [dir=back tooltip="include"]
    "31" -> "13" [dir=back tooltip="include"]
    "46" -> "5" [dir=back tooltip="include"]
    "46" -> "23" [dir=back tooltip="include"]
    "46" -> "28" [dir=back tooltip="include"]
    "46" -> "9" [dir=back tooltip="include"]
    "46" -> "24" [dir=back tooltip="include"]
    "46" -> "39" [dir=back tooltip="include"]
    "4" -> "5" [dir=back tooltip="include"]
    "4" -> "3" [dir=back tooltip="include"]
    "4" -> "10" [dir=back tooltip="include"]
    "4" -> "14" [dir=back tooltip="include"]
    "4" -> "19" [dir=back tooltip="include"]
    "4" -> "15" [dir=back tooltip="include"]
    "4" -> "20" [dir=back tooltip="include"]
    "4" -> "12" [dir=back tooltip="include"]
    "4" -> "7" [dir=back tooltip="include"]
    "4" -> "23" [dir=back tooltip="include"]
    "4" -> "8" [dir=back tooltip="include"]
    "4" -> "28" [dir=back tooltip="include"]
    "4" -> "29" [dir=back tooltip="include"]
    "4" -> "30" [dir=back tooltip="include"]
    "4" -> "17" [dir=back tooltip="include"]
    "4" -> "18" [dir=back tooltip="include"]
    "4" -> "31" [dir=back tooltip="include"]
    "4" -> "25" [dir=back tooltip="include"]
    "4" -> "22" [dir=back tooltip="include"]
    "30" -> "8" [dir=back tooltip="include"]
    "30" -> "29" [dir=back tooltip="include"]
    "48" -> "6" [dir=back tooltip="include"]
    "25" -> "9" [dir=back tooltip="include"]
    "25" -> "26" [dir=back tooltip="include"]
    "41" -> "15" [dir=back tooltip="include"]
    "41" -> "12" [dir=back tooltip="include"]
    "41" -> "17" [dir=back tooltip="include"]
    "41" -> "18" [dir=back tooltip="include"]
    "41" -> "42" [dir=back tooltip="include"]
    "40" -> "3" [dir=back tooltip="include"]
    "40" -> "4" [dir=back tooltip="include"]
    "40" -> "32" [dir=back tooltip="include"]
    "40" -> "8" [dir=back tooltip="include"]
    "40" -> "9" [dir=back tooltip="include"]
    "40" -> "29" [dir=back tooltip="include"]
    "23" -> "5" [dir=back tooltip="include"]
    "23" -> "7" [dir=back tooltip="include"]
    "23" -> "8" [dir=back tooltip="include"]
    "23" -> "9" [dir=back tooltip="include"]
    "23" -> "24" [dir=back tooltip="include"]
    "23" -> "25" [dir=back tooltip="include"]
    "23" -> "27" [dir=back tooltip="include"]
    "34" -> "35" [dir=back tooltip="include"]
    "34" -> "15" [dir=back tooltip="include"]
    "34" -> "8" [dir=back tooltip="include"]
    "42" -> "43" [dir=back tooltip="include"]
    "42" -> "3" [dir=back tooltip="include"]
    "42" -> "4" [dir=back tooltip="include"]
    "42" -> "38" [dir=back tooltip="include"]
    "42" -> "45" [dir=back tooltip="include"]
    "42" -> "46" [dir=back tooltip="include"]
    "42" -> "47" [dir=back tooltip="include"]
    "42" -> "33" [dir=back tooltip="include"]
    "42" -> "21" [dir=back tooltip="include"]
    "42" -> "20" [dir=back tooltip="include"]
    "42" -> "12" [dir=back tooltip="include"]
    "42" -> "7" [dir=back tooltip="include"]
    "42" -> "23" [dir=back tooltip="include"]
    "42" -> "8" [dir=back tooltip="include"]
    "42" -> "48" [dir=back tooltip="include"]
    "42" -> "30" [dir=back tooltip="include"]
    "42" -> "39" [dir=back tooltip="include"]
    "42" -> "25" [dir=back tooltip="include"]
    "42" -> "22" [dir=back tooltip="include"]
    "20" -> "21" [dir=back tooltip="include"]
    "20" -> "8" [dir=back tooltip="include"]
    "20" -> "16" [dir=back tooltip="include"]
    "20" -> "22" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "33" [dir=back tooltip="include"]
    "1" -> "40" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
    "1" -> "8" [dir=back tooltip="include"]
    "1" -> "41" [dir=back tooltip="include"]
    "1" -> "13" [dir=back tooltip="include"]
    "1" -> "49" [dir=back tooltip="include"]
    "1" -> "50" [dir=back tooltip="include"]
    "14" -> "3" [dir=back tooltip="include"]
    "14" -> "15" [dir=back tooltip="include"]
    "14" -> "12" [dir=back tooltip="include"]
    "14" -> "16" [dir=back tooltip="include"]
    "14" -> "17" [dir=back tooltip="include"]
    "14" -> "18" [dir=back tooltip="include"]
    "27" -> "3" [dir=back tooltip="include"]
    "27" -> "15" [dir=back tooltip="include"]
    "27" -> "7" [dir=back tooltip="include"]
    "27" -> "8" [dir=back tooltip="include"]
    "27" -> "18" [dir=back tooltip="include"]
    "27" -> "13" [dir=back tooltip="include"]
    "28" -> "7" [dir=back tooltip="include"]
    "28" -> "8" [dir=back tooltip="include"]
    "28" -> "9" [dir=back tooltip="include"]
    "28" -> "16" [dir=back tooltip="include"]
    "9" -> "3" [dir=back tooltip="include"]
    "9" -> "7" [dir=back tooltip="include"]
    "10" -> "11" [dir=back tooltip="include"]
    "10" -> "12" [dir=back tooltip="include"]
    "10" -> "9" [dir=back tooltip="include"]
    "10" -> "13" [dir=back tooltip="include"]
    "33" -> "34" [dir=back tooltip="include"]
    "33" -> "3" [dir=back tooltip="include"]
    "33" -> "4" [dir=back tooltip="include"]
    "33" -> "36" [dir=back tooltip="include"]
    "33" -> "15" [dir=back tooltip="include"]
    "33" -> "7" [dir=back tooltip="include"]
    "33" -> "23" [dir=back tooltip="include"]
    "33" -> "8" [dir=back tooltip="include"]
    "33" -> "29" [dir=back tooltip="include"]
    "33" -> "30" [dir=back tooltip="include"]
    "33" -> "16" [dir=back tooltip="include"]
    "33" -> "39" [dir=back tooltip="include"]
    "33" -> "31" [dir=back tooltip="include"]
    "33" -> "26" [dir=back tooltip="include"]
    "33" -> "27" [dir=back tooltip="include"]
    "47" -> "19" [dir=back tooltip="include"]
    "47" -> "7" [dir=back tooltip="include"]
    "47" -> "8" [dir=back tooltip="include"]
}

Defines

CLANG_THREAD_SANITIZE_SAFE
ATOMIC_COMPARE_EXCHANGE_WEAK
ATOMIC
TYPEDEF_MUTEX
TYPEDEF_SPINLOCK
TYPEDEF_CONDVAR
TYPEDEF_RWLOCK
TYPEDEF_GLOBALCONTEXT

Typedefs

typedef struct Mutex Mutex
typedef struct SpinLock SpinLock
typedef struct CondVar CondVar
typedef struct RWLock RWLock
typedef struct GlobalContext GlobalContext

Functions

Mutex *smp_mutex_create()
void smp_mutex_destroy(Mutex *mtx)
void smp_mutex_lock(Mutex *mtx)
bool smp_mutex_trylock(Mutex *mtx)
void smp_mutex_unlock(Mutex *mtx)
CondVar *smp_condvar_create()
void smp_condvar_destroy(CondVar *cv)
void smp_condvar_wait(CondVar *cv, Mutex *mtx)
void smp_condvar_signal(CondVar *cv)
RWLock *smp_rwlock_create()
void smp_rwlock_destroy(RWLock *lock)
void smp_rwlock_rdlock(RWLock *lock)
void smp_rwlock_wrlock(RWLock *lock)
void smp_rwlock_unlock(RWLock *lock)
static inline void smp_spinlock_init(SpinLock *lock)
static inline void smp_spinlock_lock(SpinLock *lock)
static inline void smp_spinlock_unlock(SpinLock *lock)
int smp_get_online_processors()
void smp_scheduler_start(GlobalContext *glb)
bool smp_is_main_thread(GlobalContext *glb)
struct SpinLock

Public Members

int ATOMIC lock