nl::Weave::System::Mutex

#include <src/system/SystemMutex.h>

This class represents a simple mutual exclusion lock used on platforms with preemptively scheduled multi-threaded
programming environments, for example, POSIX threads and FreeRTOS.

Summary

The lock is non-recursive, and may not be used in a hardware interrupt context. The constructor and destructor are defined as null functions to facilitate using objects with static storage duration and uninitialized memory. Use Init method to initialize. The copy/move operators are not provided.

Constructors and Destructors

Mutex(void)
~Mutex(void)

Public functions

Lock(void)
void
Acquire the mutual exclusion lock, blocking the current thread indefinitely if necessary.
Unlock(void)
void
Release the mutual exclusion lock (can block on some systems until scheduler completes).

Public static functions

Init(Mutex & aMutex)
Error

Public functions

Lock

void Lock(
  void
)

Acquire the mutual exclusion lock, blocking the current thread indefinitely if necessary.

Mutex

 Mutex(
  void
)

Unlock

void Unlock(
  void
)

Release the mutual exclusion lock (can block on some systems until scheduler completes).

~Mutex

 ~Mutex(
  void
)

Public static functions

Init

Error Init(
  Mutex & aMutex
)