NeKernel dev
Loading...
Searching...
No Matches
Semaphore.h File Reference

Semaphore structure and functions for synchronization in the kernel. More...

Go to the source code of this file.

Namespaces

namespace  Kernel
 UPS inline definitions.

Macros

#define kSemaphoreOwnerIndex   (0U)
#define kSemaphoreCountIndex   (1U)
#define kSemaphoreCount   (2U)
#define kSemaphoreIncrementOwner(sem)
#define kSemaphoreDecrementOwner(sem)

Typedefs

typedef UInt64 Kernel::SemaphoreArr[kSemaphoreCount]
 Semaphore structure used for synchronization.

Functions

BOOL Kernel::rtl_sem_is_valid (const SemaphoreArr &sem, UInt64 owner=0)
 Checks if the semaphore is valid.
BOOL Kernel::rtl_sem_release (SemaphoreArr &sem)
 Releases the semaphore, resetting its owner and count.
BOOL Kernel::rtl_sem_acquire (SemaphoreArr &sem, UInt64 owner)
 Initializes the semaphore with an owner and a count of zero.
BOOL Kernel::rtl_sem_wait (SemaphoreArr &sem, UInt64 owner, UInt64 timeout, BOOL *condition=nullptr)
 Waits for the semaphore to be available, blocking until it is.

Detailed Description

Semaphore structure and functions for synchronization in the kernel.

Author
Amlal El Mahrouss

Macro Definition Documentation

◆ kSemaphoreCount

#define kSemaphoreCount   (2U)

◆ kSemaphoreCountIndex

#define kSemaphoreCountIndex   (1U)

◆ kSemaphoreDecrementOwner

#define kSemaphoreDecrementOwner ( sem)
Value:
#define kSemaphoreOwnerIndex
Definition Semaphore.h:17

◆ kSemaphoreIncrementOwner

#define kSemaphoreIncrementOwner ( sem)
Value:

◆ kSemaphoreOwnerIndex

#define kSemaphoreOwnerIndex   (0U)