Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
spinlock.h File Reference
#include <stdint.h>
#include "utils/arax_assert.h"
+ Include dependency graph for spinlock.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef volatile uint32_t utils_spinlock
 

Functions

static void utils_spinlock_init (utils_spinlock *lock)
 
static void utils_spinlock_lock (utils_spinlock *lock)
 
static void utils_spinlock_unlock (utils_spinlock *lock)
 

Typedef Documentation

◆ utils_spinlock

typedef volatile uint32_t utils_spinlock

Definition at line 10 of file spinlock.h.

Function Documentation

◆ utils_spinlock_init()

static void utils_spinlock_init ( utils_spinlock * lock)
inlinestatic

Initialize lock as unlocked.

Parameters
lockutils_spinlock to be initialized as unlocked.

Definition at line 19 of file spinlock.h.

◆ utils_spinlock_lock()

static void utils_spinlock_lock ( utils_spinlock * lock)
inlinestatic

Lock lock.

Will attempt to lock lock. Will spin until succesfull.

Parameters
lockutils_spinlock instance to be locked.

Definition at line 32 of file spinlock.h.

◆ utils_spinlock_unlock()

static void utils_spinlock_unlock ( utils_spinlock * lock)
inlinestatic

Will unlock lock that was previously locked.

Note
Calling utils_spinlock_unlock on an unlocked utils_spinlock instance is an error.
Parameters
lockutils_spinlock instance to be unlocked.

Definition at line 48 of file spinlock.h.

References arax_assert.