FreeRTOS C-Addons  1.1.0
C-Addon functionality to FreeRTOS
Typedefs | Functions
read_write_lock.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void * ReadWriteLock_t
 

Functions

ReadWriteLock_tCreateReadWriteLockPreferReader (void)
 
ReadWriteLock_tCreateReadWriteLockPreferWriter (void)
 
void FreeReadWriteLock (ReadWriteLock_t *lock)
 
void ReaderLock (ReadWriteLock_t *Lock)
 
void ReaderUnlock (ReadWriteLock_t *Lock)
 
void WriterLock (ReadWriteLock_t *Lock)
 
void WriterUnlock (ReadWriteLock_t *Lock)
 

Typedef Documentation

◆ ReadWriteLock_t

typedef void* ReadWriteLock_t

Handle for Reader/Writer locks.

Definition at line 47 of file read_write_lock.h.

Function Documentation

◆ CreateReadWriteLockPreferReader()

ReadWriteLock_t* CreateReadWriteLockPreferReader ( void  )

Create a Reader/Writer lock that offers preference to all readers.

Returns
A handle to the lock, or NULL on failure.

Definition at line 132 of file read_write_lock.c.

◆ CreateReadWriteLockPreferWriter()

ReadWriteLock_t* CreateReadWriteLockPreferWriter ( void  )

Create a Reader/Writer lock that offers preference to all writers.

Returns
A handle to the lock, or NULL on failure.

Definition at line 198 of file read_write_lock.c.

◆ FreeReadWriteLock()

void FreeReadWriteLock ( ReadWriteLock_t lock)

Free an already allocated Reader/Writer lock.

Parameters
lockThe lock you are freeing.

Definition at line 296 of file read_write_lock.c.

◆ ReaderLock()

void ReaderLock ( ReadWriteLock_t Lock)

Lock as a Reader.

This allows you shared read only access to whatever is being protected by this lock.

Parameters
LockThe lock you are taking.

Definition at line 321 of file read_write_lock.c.

◆ ReaderUnlock()

void ReaderUnlock ( ReadWriteLock_t Lock)

Unlock as a Reader.

You should have already locked this using ReaderLock().

Parameters
LockThe lock you are releasing.

Definition at line 359 of file read_write_lock.c.

◆ WriterLock()

void WriterLock ( ReadWriteLock_t Lock)

Lock as a Writer.

This allows you exclusive read / write access to whatever is being protected by this lock.

Parameters
LockThe lock you are taking.

Definition at line 395 of file read_write_lock.c.

◆ WriterUnlock()

void WriterUnlock ( ReadWriteLock_t Lock)

Unlock as a Writer.

You should have already locked this using WriterLock().

Parameters
LockThe lock you are releasing.

Definition at line 427 of file read_write_lock.c.