Max OS 0.3
Loading...
Searching...
No Matches
spinlock.h File Reference

Defines Spinlock and BlockingLock classes for thread synchronization. More...

#include <common/vector.h>

Go to the source code of this file.

Classes

class  MaxOS::common::Spinlock
 Enables a resource to be used by only one instance at a time through locking and unlocking. More...
 
class  MaxOS::common::BlockingLock
 Enables a resource to be used by only one instance at a time through a combination of spinning and queuing. When waiting enqueued, thread will sleep. More...
 

Variables

constexpr uint8_t MaxOS::common::BLOCKING_FAST_TRY_LIMIT = UINT8_MAX
 How many attempts to acquire the lock should fail before queueing.
 

Detailed Description

Defines Spinlock and BlockingLock classes for thread synchronization.

Date
24th February 2025
Author
Max Tyson

Definition in file spinlock.h.

Variable Documentation

◆ BLOCKING_FAST_TRY_LIMIT

constexpr uint8_t MaxOS::common::BLOCKING_FAST_TRY_LIMIT = UINT8_MAX
constexpr

How many attempts to acquire the lock should fail before queueing.

Definition at line 40 of file spinlock.h.

Referenced by MaxOS::common::BlockingLock::acquire().