Counting Semaphore of the QXK preemptive kernel.
More...
Counting Semaphore of the QXK preemptive kernel.
- Details
- QXSemaphore is a blocking mechanism intended primarily for signaling extended threads. The semaphore is initialized with the maximum count (see QXSemaphore_init()), which allows you to create a binary semaphore (when the maximum count is 1) and counting semaphore when the maximum count is > 1.
- Usage
- The following example illustrates how to instantiate and use the semaphore in your application.
int main() {
. . .
QXSemaphore_init(&BTN_sema,
0U,
1U);
. . .
}
void main_threadXYZ(
QXThread *
const me) {
while (1) {
. . .
QXSemaphore_wait(&BTN_sema,
QXTHREAD_NO_TIMEOUT);
. . .
}
}
void GPIO_Handler(void) {
. . .
QXSemaphore_signal(&BTN_sema);
. . .
}
Counting Semaphore of the QXK preemptive kernel.
eXtended (blocking) thread of the QXK preemptive kernel
The documentation for this class was generated from the following file: