QP/C
Functions | Variables
qk_mutex.c File Reference

QK_mutexLock()/QK_mutexUnlock() implementation. More...

#include "qk_pkg.h"

Go to the source code of this file.

Functions

QMutex QK_mutexLock (uint8_t prioCeiling)
 QK priority-ceiling mutex lock.
void QK_mutexUnlock (QMutex mutex)
 QK priority-ceiling mutex unlock.

Variables

uint8_t QK_ceilingPrio_

Detailed Description

QK_mutexLock()/QK_mutexUnlock() implementation.

Definition in file qk_mutex.c.


Function Documentation

QMutex QK_mutexLock ( uint8_t const  prioCeiling)

QK priority-ceiling mutex lock.

Lock the QK scheduler up to the priority level prioCeiling.

Note:
This function should be always paired with QK_mutexUnlock(). The code between QK_mutexLock() and QK_mutexUnlock() should be kept to the minimum.
    QMutex mux;
    . . .
    mux = QK_mutexLock(PRIO_CEILING);

    /* access the shared resource */

    QK_mutexUnlock(mux);

    . . . 

Definition at line 54 of file qk_mutex.c.

References QK_ceilingPrio_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_MUTEX_LOCK, QS_TIME_, and QS_U8_.

void QK_mutexUnlock ( QMutex  mutex)

QK priority-ceiling mutex unlock.

Note:
This function should be always paired with QK_mutexLock(). The code between QK_mutexLock() and QK_mutexUnlock() should be kept to the minimum.
    QMutex mux;
    . . .
    mux = QK_mutexLock(PRIO_CEILING);

    /* access the shared resource */

    QK_mutexUnlock(mux);

    . . . 

Definition at line 73 of file qk_mutex.c.

References QK_ceilingPrio_, QK_sched_(), QK_schedPrio_(), QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_MUTEX_UNLOCK, QS_TIME_, and QS_U8_.


Variable Documentation

uint8_t QK_ceilingPrio_

QK mutex priority ceiling

Definition at line 51 of file qk_mutex.c.

Referenced by QK_mutexLock(), QK_mutexUnlock(), and QK_schedPrio_().