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"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/smp.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/smp.h" fillcolor="#BFBFBF"]
    "1" -> "2" [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"]
    "26" [label="/__w/AtomVM/AtomVM/src/libAtomVM/interop.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/interop.c"]
    "18" [label="/__w/AtomVM/AtomVM/src/libAtomVM/refc_binary.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/refc_binary.c"]
    "22" [label="/__w/AtomVM/AtomVM/src/libAtomVM/interop.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/interop.h"]
    "13" [label="/__w/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h"]
    "9" [label="/__w/AtomVM/AtomVM/src/libAtomVM/nifs.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/nifs.c"]
    "34" [label="/__w/AtomVM/AtomVM/src/libAtomVM/nifs.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/nifs.h"]
    "49" [label="/__w/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h"]
    "50" [label="/__w/AtomVM/AtomVM/src/libAtomVM/dictionary.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/dictionary.c"]
    "53" [label="/__w/AtomVM/AtomVM/src/libAtomVM/synclist.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/synclist.h"]
    "4" [label="/__w/AtomVM/AtomVM/src/libAtomVM/context.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/context.c"]
    "7" [label="/__w/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/bif.c"]
    "5" [label="/__w/AtomVM/AtomVM/src/libAtomVM/context.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/context.h"]
    "6" [label="/__w/AtomVM/AtomVM/src/libAtomVM/bif.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/bif.h"]
    "45" [label="/__w/AtomVM/AtomVM/src/libAtomVM/ets_hashtable.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/ets_hashtable.c"]
    "27" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c"]
    "51" [label="/__w/AtomVM/AtomVM/src/libAtomVM/ets_hashtable.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/ets_hashtable.h"]
    "40" [label="/__w/AtomVM/AtomVM/src/libAtomVM/portnifloader.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/portnifloader.c"]
    "35" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h"]
    "12" [label="/__w/AtomVM/AtomVM/src/libAtomVM/memory.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/memory.c"]
    "39" [label="/__w/AtomVM/AtomVM/src/libAtomVM/portnifloader.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/portnifloader.h"]
    "33" [label="/__w/AtomVM/AtomVM/src/libAtomVM/sys.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/sys.h"]
    "8" [label="/__w/AtomVM/AtomVM/src/libAtomVM/module.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/module.c"]
    "29" [label="/__w/AtomVM/AtomVM/src/libAtomVM/module.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/module.h"]
    "25" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_net.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_net.c"]
    "36" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_net.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_net.h"]
    "55" [label="/__w/AtomVM/AtomVM/src/libAtomVM/valueshashtable.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/valueshashtable.c"]
    "19" [label="/__w/AtomVM/AtomVM/src/libAtomVM/resources.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/resources.c"]
    "24" [label="/__w/AtomVM/AtomVM/src/libAtomVM/inet.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/inet.c"]
    "28" [label="/__w/AtomVM/AtomVM/src/libAtomVM/term.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/term.c"]
    "23" [label="/__w/AtomVM/AtomVM/src/libAtomVM/inet.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/inet.h"]
    "11" [label="/__w/AtomVM/AtomVM/src/libAtomVM/debug.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/debug.c"]
    "10" [label="/__w/AtomVM/AtomVM/src/libAtomVM/debug.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/debug.h"]
    "2" [label="/__w/AtomVM/AtomVM/src/libAtomVM/atom_table.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/atom_table.c"]
    "21" [label="/__w/AtomVM/AtomVM/src/libAtomVM/externalterm.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/externalterm.c"]
    "48" [label="/__w/AtomVM/AtomVM/src/libAtomVM/avmpack.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/avmpack.c"]
    "47" [label="/__w/AtomVM/AtomVM/src/libAtomVM/avmpack.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/avmpack.h"]
    "14" [label="/__w/AtomVM/AtomVM/src/libAtomVM/globalcontext.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/globalcontext.c"]
    "46" [label="/__w/AtomVM/AtomVM/src/libAtomVM/globalcontext.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/globalcontext.h"]
    "30" [label="/__w/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h"]
    "43" [label="/__w/AtomVM/AtomVM/src/libAtomVM/scheduler.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/scheduler.h"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/smp.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/smp.h" fillcolor="#BFBFBF"]
    "3" [label="/__w/AtomVM/AtomVM/src/libAtomVM/atomshashtable.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/atomshashtable.c"]
    "15" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_socket.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_socket.c"]
    "37" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_socket.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_socket.h"]
    "32" [label="/__w/AtomVM/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/stacktrace.c"]
    "31" [label="/__w/AtomVM/AtomVM/src/libAtomVM/stacktrace.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/stacktrace.h"]
    "16" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c"]
    "38" [label="/__w/AtomVM/AtomVM/src/libAtomVM/otp_ssl.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/otp_ssl.h"]
    "17" [label="/__w/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c"]
    "52" [label="/__w/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h"]
    "44" [label="/__w/AtomVM/AtomVM/src/libAtomVM/mailbox.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/mailbox.c"]
    "41" [label="/__w/AtomVM/AtomVM/src/libAtomVM/port.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/port.c"]
    "42" [label="/__w/AtomVM/AtomVM/src/libAtomVM/port.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/port.h"]
    "20" [label="/__w/AtomVM/AtomVM/src/libAtomVM/ets.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/ets.c"]
    "54" [label="/__w/AtomVM/AtomVM/src/libAtomVM/ets.h" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/ets.h"]
    "22" -> "23" [dir=back tooltip="include"]
    "22" -> "26" [dir=back tooltip="include"]
    "22" -> "9" [dir=back tooltip="include"]
    "22" -> "27" [dir=back tooltip="include"]
    "22" -> "25" [dir=back tooltip="include"]
    "22" -> "15" [dir=back tooltip="include"]
    "22" -> "16" [dir=back tooltip="include"]
    "22" -> "17" [dir=back tooltip="include"]
    "22" -> "28" [dir=back tooltip="include"]
    "13" -> "4" [dir=back tooltip="include"]
    "13" -> "14" [dir=back tooltip="include"]
    "13" -> "12" [dir=back tooltip="include"]
    "13" -> "15" [dir=back tooltip="include"]
    "13" -> "16" [dir=back tooltip="include"]
    "13" -> "17" [dir=back tooltip="include"]
    "13" -> "18" [dir=back tooltip="include"]
    "13" -> "19" [dir=back tooltip="include"]
    "34" -> "8" [dir=back tooltip="include"]
    "34" -> "9" [dir=back tooltip="include"]
    "34" -> "27" [dir=back tooltip="include"]
    "34" -> "35" [dir=back tooltip="include"]
    "34" -> "25" [dir=back tooltip="include"]
    "34" -> "36" [dir=back tooltip="include"]
    "34" -> "15" [dir=back tooltip="include"]
    "34" -> "37" [dir=back tooltip="include"]
    "34" -> "16" [dir=back tooltip="include"]
    "34" -> "38" [dir=back tooltip="include"]
    "34" -> "39" [dir=back tooltip="include"]
    "34" -> "17" [dir=back tooltip="include"]
    "49" -> "7" [dir=back tooltip="include"]
    "49" -> "50" [dir=back tooltip="include"]
    "49" -> "20" [dir=back tooltip="include"]
    "49" -> "14" [dir=back tooltip="include"]
    "49" -> "26" [dir=back tooltip="include"]
    "49" -> "9" [dir=back tooltip="include"]
    "49" -> "27" [dir=back tooltip="include"]
    "49" -> "25" [dir=back tooltip="include"]
    "49" -> "15" [dir=back tooltip="include"]
    "49" -> "16" [dir=back tooltip="include"]
    "49" -> "41" [dir=back tooltip="include"]
    "49" -> "42" [dir=back tooltip="include"]
    "49" -> "17" [dir=back tooltip="include"]
    "49" -> "19" [dir=back tooltip="include"]
    "49" -> "32" [dir=back tooltip="include"]
    "53" -> "4" [dir=back tooltip="include"]
    "53" -> "54" [dir=back tooltip="include"]
    "53" -> "14" [dir=back tooltip="include"]
    "53" -> "46" [dir=back tooltip="include"]
    "53" -> "44" [dir=back tooltip="include"]
    "53" -> "9" [dir=back tooltip="include"]
    "5" -> "6" [dir=back tooltip="include"]
    "5" -> "4" [dir=back tooltip="include"]
    "5" -> "10" [dir=back tooltip="include"]
    "5" -> "13" [dir=back tooltip="include"]
    "5" -> "20" [dir=back tooltip="include"]
    "5" -> "21" [dir=back tooltip="include"]
    "5" -> "14" [dir=back tooltip="include"]
    "5" -> "22" [dir=back tooltip="include"]
    "5" -> "12" [dir=back tooltip="include"]
    "5" -> "8" [dir=back tooltip="include"]
    "5" -> "29" [dir=back tooltip="include"]
    "5" -> "9" [dir=back tooltip="include"]
    "5" -> "34" [dir=back tooltip="include"]
    "5" -> "27" [dir=back tooltip="include"]
    "5" -> "25" [dir=back tooltip="include"]
    "5" -> "15" [dir=back tooltip="include"]
    "5" -> "16" [dir=back tooltip="include"]
    "5" -> "41" [dir=back tooltip="include"]
    "5" -> "42" [dir=back tooltip="include"]
    "5" -> "39" [dir=back tooltip="include"]
    "5" -> "18" [dir=back tooltip="include"]
    "5" -> "19" [dir=back tooltip="include"]
    "5" -> "43" [dir=back tooltip="include"]
    "5" -> "31" [dir=back tooltip="include"]
    "5" -> "28" [dir=back tooltip="include"]
    "6" -> "7" [dir=back tooltip="include"]
    "6" -> "8" [dir=back tooltip="include"]
    "6" -> "9" [dir=back tooltip="include"]
    "51" -> "20" [dir=back tooltip="include"]
    "51" -> "45" [dir=back tooltip="include"]
    "35" -> "27" [dir=back tooltip="include"]
    "39" -> "40" [dir=back tooltip="include"]
    "33" -> "4" [dir=back tooltip="include"]
    "33" -> "14" [dir=back tooltip="include"]
    "33" -> "8" [dir=back tooltip="include"]
    "33" -> "9" [dir=back tooltip="include"]
    "33" -> "15" [dir=back tooltip="include"]
    "33" -> "19" [dir=back tooltip="include"]
    "29" -> "6" [dir=back tooltip="include"]
    "29" -> "8" [dir=back tooltip="include"]
    "29" -> "9" [dir=back tooltip="include"]
    "29" -> "30" [dir=back tooltip="include"]
    "29" -> "31" [dir=back tooltip="include"]
    "29" -> "33" [dir=back tooltip="include"]
    "29" -> "28" [dir=back tooltip="include"]
    "36" -> "25" [dir=back tooltip="include"]
    "23" -> "24" [dir=back tooltip="include"]
    "23" -> "25" [dir=back tooltip="include"]
    "23" -> "15" [dir=back tooltip="include"]
    "23" -> "16" [dir=back tooltip="include"]
    "10" -> "11" [dir=back tooltip="include"]
    "10" -> "12" [dir=back tooltip="include"]
    "47" -> "48" [dir=back tooltip="include"]
    "47" -> "14" [dir=back tooltip="include"]
    "47" -> "9" [dir=back tooltip="include"]
    "46" -> "47" [dir=back tooltip="include"]
    "46" -> "4" [dir=back tooltip="include"]
    "46" -> "5" [dir=back tooltip="include"]
    "46" -> "49" [dir=back tooltip="include"]
    "46" -> "51" [dir=back tooltip="include"]
    "46" -> "14" [dir=back tooltip="include"]
    "46" -> "12" [dir=back tooltip="include"]
    "46" -> "8" [dir=back tooltip="include"]
    "46" -> "29" [dir=back tooltip="include"]
    "46" -> "9" [dir=back tooltip="include"]
    "46" -> "27" [dir=back tooltip="include"]
    "46" -> "25" [dir=back tooltip="include"]
    "46" -> "36" [dir=back tooltip="include"]
    "46" -> "15" [dir=back tooltip="include"]
    "46" -> "37" [dir=back tooltip="include"]
    "46" -> "16" [dir=back tooltip="include"]
    "46" -> "38" [dir=back tooltip="include"]
    "46" -> "41" [dir=back tooltip="include"]
    "46" -> "42" [dir=back tooltip="include"]
    "46" -> "39" [dir=back tooltip="include"]
    "46" -> "17" [dir=back tooltip="include"]
    "46" -> "52" [dir=back tooltip="include"]
    "46" -> "43" [dir=back tooltip="include"]
    "46" -> "32" [dir=back tooltip="include"]
    "46" -> "33" [dir=back tooltip="include"]
    "30" -> "9" [dir=back tooltip="include"]
    "43" -> "14" [dir=back tooltip="include"]
    "43" -> "44" [dir=back tooltip="include"]
    "43" -> "9" [dir=back tooltip="include"]
    "43" -> "15" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
    "1" -> "45" [dir=back tooltip="include"]
    "1" -> "14" [dir=back tooltip="include"]
    "1" -> "46" [dir=back tooltip="include"]
    "1" -> "8" [dir=back tooltip="include"]
    "1" -> "9" [dir=back tooltip="include"]
    "1" -> "53" [dir=back tooltip="include"]
    "1" -> "55" [dir=back tooltip="include"]
    "37" -> "15" [dir=back tooltip="include"]
    "37" -> "16" [dir=back tooltip="include"]
    "31" -> "32" [dir=back tooltip="include"]
    "38" -> "16" [dir=back tooltip="include"]
    "52" -> "14" [dir=back tooltip="include"]
    "52" -> "9" [dir=back tooltip="include"]
    "52" -> "15" [dir=back tooltip="include"]
    "52" -> "17" [dir=back tooltip="include"]
    "42" -> "24" [dir=back tooltip="include"]
    "42" -> "9" [dir=back tooltip="include"]
    "42" -> "25" [dir=back tooltip="include"]
    "42" -> "15" [dir=back tooltip="include"]
    "42" -> "16" [dir=back tooltip="include"]
    "42" -> "41" [dir=back tooltip="include"]
    "54" -> "20" [dir=back tooltip="include"]
    "54" -> "46" [dir=back tooltip="include"]
    "54" -> "9" [dir=back tooltip="include"]
}

Multicore support functions.

This header defines multicore support functions to be implemented for SMP builds.

Defines

CLANG_THREAD_SANITIZE_SAFE
ATOMIC
TYPEDEF_MUTEX
TYPEDEF_SPINLOCK
TYPEDEF_CONDVAR
TYPEDEF_RWLOCK
TYPEDEF_GLOBALCONTEXT
SMP_SPINLOCK_LOCK(spinlock) smp_spinlock_lock(spinlock)
SMP_SPINLOCK_TRYLOCK(spinlock) smp_spinlock_trylock(spinlock)
SMP_SPINLOCK_UNLOCK(spinlock) smp_spinlock_unlock(spinlock)
SMP_MUTEX_LOCK(mutex) smp_mutex_lock(mutex)
SMP_MUTEX_TRYLOCK(mutex) smp_mutex_trylock(mutex)
SMP_MUTEX_UNLOCK(mutex) smp_mutex_unlock(mutex)
SMP_RWLOCK_RDLOCK(lock) smp_rwlock_rdlock(lock)
SMP_RWLOCK_TRYRDLOCK(lock) smp_rwlock_tryrdlock(lock)
SMP_RWLOCK_WRLOCK(lock) smp_rwlock_wrlock(lock)
SMP_RWLOCK_UNLOCK(lock) smp_rwlock_unlock(lock)

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()

Create a new mutex.

Returns:

a pointer to a mutex.

void smp_mutex_destroy(Mutex *mtx)

Destroy a mutex.

Parameters:
  • mtx – the mutex to destroy

void smp_mutex_lock(Mutex *mtx)

Lock a mutex.

Parameters:
  • mtx – the mutex to lock

bool smp_mutex_trylock(Mutex *mtx)

Try and lock a mutex.

Parameters:
  • mtx – the mutex to lock

Returns:

true if the mutex was acquired.

void smp_mutex_unlock(Mutex *mtx)

Unlock a mutex.

Parameters:
  • mtx – the mutex to unlock

CondVar *smp_condvar_create()

Create a new condition variable.

Returns:

a pointer to a cv.

void smp_condvar_destroy(CondVar *cv)

Destroy a condition variable.

Parameters:
  • cv – variable to destroy.

void smp_condvar_wait(CondVar *cv, Mutex *mtx)

Wait on a condition variable, atomically unlocking the mutex.

Parameters:
  • cv – variable to wait on.

  • mtx – mutex to unlock/lock.

void smp_condvar_signal(CondVar *cv)

Signal a single thread waiting on a condition variable.

Parameters:
  • cv – variable to signal.

RWLock *smp_rwlock_create()

Create a new rwlock.

A RW Lock can be replaced by a mutex if RW Lock are not available on the platform.

Returns:

a pointer to a lock.

void smp_rwlock_destroy(RWLock *lock)

Destroy a rwlock.

Parameters:
  • lock – the lock to destroy

void smp_rwlock_rdlock(RWLock *lock)

Read lock a rwlock.

Parameters:
  • lock – the lock to read lock

bool smp_rwlock_tryrdlock(RWLock *lock)

Try to acquire read lock of a rwlock.

Parameters:
  • lock – the lock to read lock

Returns:

true if lock was acquired

void smp_rwlock_wrlock(RWLock *lock)

Write lock a rwlock.

Parameters:
  • lock – the lock to write lock

void smp_rwlock_unlock(RWLock *lock)

Unlock a rwlock.

Parameters:
  • lock – the lock to unlock

static inline void smp_spinlock_init(SpinLock *lock)

Initialize a spinlock based on atomics.

Parameters:
  • lock – the spin lock to initialize

static inline void smp_spinlock_lock(SpinLock *lock)

Lock a spinlock.

Parameters:
  • lock – the spin lock to lock

static inline bool smp_spinlock_trylock(SpinLock *lock)

Try to lock a spinlock.

Parameters:
  • lock – the spin lock to lock

Returns:

true if the spin lock was locked

static inline void smp_spinlock_unlock(SpinLock *lock)

Unlock a spinlock.

Parameters:
  • lock – the spin lock to unlock

int smp_get_online_processors()

Get the number of online processors to configure schedulers.

This value is one plus the maximum number of times smp_scheduler_start will be called by the scheduler.

Returns:

the number of online processors.

void smp_scheduler_start(GlobalContext *glb)

Start a new scheduler, calling scheduler_entry_point with the given global context.

Parameters:
  • glb – the global context

bool smp_is_main_thread(GlobalContext *glb)

Determine if caller is in the main thread, i.e. thread that was not started with acmsmp_scheduler_start.

struct SpinLock
#include <smp.h>

Public Members

int lock