ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::SemaphoreObject Struct Reference

Public Member Functions

 SemaphoreObject (i32 initial_count, i32 maximum_count_in)
 SemaphoreObject (const X_KSEMAPHORE &header)
bool Release (i32 release_count, i32 *out_previous_count)

Public Attributes

PublishedPtr< rex::platform::Semaphore > semaphore
u32 maximum_count = 0

Constructor & Destructor Documentation

◆ SemaphoreObject() [1/2]

rex::kernel::SemaphoreObject::SemaphoreObject ( i32 initial_count,
i32 maximum_count_in )

Constructs a semaphore from a starting count and a maximum count.

Parameters
maximum_count_inThe count the semaphore cannot exceed.

◆ SemaphoreObject() [2/2]

rex::kernel::SemaphoreObject::SemaphoreObject ( const X_KSEMAPHORE & header)
explicit

Constructs a semaphore from a guest semaphore.

Parameters
headerThe guest semaphore whose signal state and limit initialize the object.

Member Function Documentation

◆ Release()

bool rex::kernel::SemaphoreObject::Release ( i32 release_count,
i32 * out_previous_count )

Releases a semaphore.

Parameters
out_previous_countReceives the count before the release, may be null.
Returns
True when the release stayed within the maximum count.

Member Data Documentation

◆ semaphore

PublishedPtr<rex::platform::Semaphore> rex::kernel::SemaphoreObject::semaphore

Host semaphore that carries the count and wakes waiters.


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