Semaphores & Mutex's

Provides synchronisation objects between threads. Later this API will allow named objects on the file-system, and for objects to be passed between processes.

Mutex API

The following table lists all functions related to the Mutex API.

API Description

BT_CreateMutex()

Creates a mutex, and returns a handle to the mutex object.

BT_PendMutex()

Causes the current thread to sleep until the specified mutex is released / signalled.

BT_ReleaseMutex()

Releases (signals) the specified mutex.

BT_PendMutexRecursive()

Causes the current thread to sleep until the specified mutex is released. Does not block if current thread owns the mutex.

BT_ReleaseMutexRecursive()

Releases a recursive mutex.

Mutex Kernel Mode API

API Description

BT_ReleaseMutexFromISR()

Releases a Mutex from an ISR context.

Semaphore API

Currently the semaphore API has not been exposed.

Kernel-space / Driver API

Design Overview

These APIs are simply wrappers to the underlying tasking kernel used, usually FreeRTOS. However direct implementations may be provided when using the BtKernel when available.

Further Reading

The full API is defined under:

os/include/process/bt_mutex.h

See the implementation under:

os/src/process/bt_mutex.c

Back