NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
spinlock.c File Reference

Single simple spinlock based on atomic memory operations. More...

#include <neorv32.h>

Functions

void spin_lock (void)
 
void spin_unlock (void)
 

Variables

static volatile uint32_t __spin_locked = 0
 

Detailed Description

Single simple spinlock based on atomic memory operations.

Function Documentation

◆ spin_lock()

void spin_lock ( void )

Spinlock: set lock.

Warning
This function is blocking until the lock is acquired and set.

◆ spin_unlock()

void spin_unlock ( void )

Spinlock: remove lock.

Variable Documentation

◆ __spin_locked

volatile uint32_t __spin_locked = 0
static

Private spinlock locked variable.