Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
bxc_waitable_desc_u Union Reference

Generic waitable descriptor. More...

#include <threading.h>

Data Structures

struct  [struct].__unnamed0__

Data Fields

struct  
bxc_semaphore_t semaphore
 Semaphore-specific reader.
bxc_event_t event
 Event-specific reader.
bxc_cs_t cs
 Critical section-specific reader.
bxc_queue_t queue
 Queue-specific reader.

Detailed Description

Generic waitable descriptor.

Field Documentation

◆ cs

bxc_cs_t bxc_waitable_desc_u::cs

Critical section-specific reader.

May be applicable when bxc_waitable_desc_t::magic is BXC_THREADING_KIND_CS_QUEUE.

Warning
Just bxc_waitable_desc_t::magic alone is not enough to differentiate between a critical section and a queue. In fact there is no logically sound way to do so. One can try to use bxc_waitable_desc_t::user_data0 to probabilistically differentiate between the two by checking whether it is a NULL (meaning likely an unused critical section), or if not, dereferencing it as a pointer and check whether it points to a value of BXC_THREADING_KIND_THREAD. If one of these is true, the descriptor is likely a critical section.

◆ event

bxc_event_t bxc_waitable_desc_u::event

Event-specific reader.

Applicable when bxc_waitable_desc_t::magic is BXC_THREADING_KIND_EVENT.

◆ queue

bxc_queue_t bxc_waitable_desc_u::queue

Queue-specific reader.

May be applicable when bxc_waitable_desc_t::magic is BXC_THREADING_KIND_CS_QUEUE.

Warning
Just bxc_waitable_desc_t::magic alone is not enough to differentiate between a critical section and a queue. In fact there is no logically sound way to do so. One can try to use bxc_waitable_desc_t::user_data0 to probabilistically differentiate between the two by checking whether it is a NULL (meaning likely an unused critical section), or if not, dereferencing it as a pointer and check whether it points to a value of BXC_THREADING_KIND_THREAD. If one of these is true, the descriptor is likely a critical section.

◆ semaphore

bxc_semaphore_t bxc_waitable_desc_u::semaphore

Semaphore-specific reader.

Applicable when bxc_waitable_desc_t::magic is BXC_THREADING_KIND_SEMAPHORE.


The documentation for this union was generated from the following file: