#include <SemaphoreCommon.hpp>
Inheritance diagram for corelinux::SemaphoreCommon:
Static Public Member Functions | |
static Int | getSemaphoreMaxValue (SemaphoreGroupPtr, Int) |
Returns the maximum value for a semaphore as defined by the original semaphore claimant. | |
static void | groupDefined (SemaphoreGroupPtr) |
When a shared semaphore group is created, it is updated in the CSA, either by increasing the count of processes accessing a particular group, or adding to the csa initially. | |
static Int | groupUnDefined (SemaphoreGroupPtr) |
When the local process is deleting a semaphore group and it is considered a shared group, we are asked to adjust the map accordingly. | |
static Int | setLock (SemaphoreGroupPtr, Int, Int, Int) |
Called by the base semaphore to aquire a lock for a specific semaphore. | |
static Int | setUnLock (SemaphoreGroupPtr, Int, Int, Int) |
Called by the base semaphore to relinquish a lock for a specific semaphore. | |
static Int | waitZero (SemaphoreGroupPtr, Int, Int, Int) |
Called by the base semaphore to wait for a specific semaphore to have a zero value. | |
static Int | obtainSemaphore (SemaphoreGroupPtr, Int, IntRef, IntRef, IntRef, Int) |
Typically called by a SemaphoreGroup prior to passing out the semaphore type to the caller. | |
static Int | relinquishSemaphore (SemaphoreGroupPtr, Int) |
Called when the semaphore is no longer being referenced. | |
static Int | setMaxValue (SemaphoreGroupPtr, Int, Int) |
Called to set the semaphore maximum value. | |
Protected Member Functions | |
SemaphoreCommon (void) | |
Default constructor used by class. | |
virtual | ~SemaphoreCommon (void) |
Destructor. | |
void | registerGroup (SemaphoreGroupPtr) |
Does the work of getting the group registered in the CSA. | |
Int | deregisterGroup (SemaphoreGroupPtr) |
Does the work of reducing the group share count, or marking the group for reclaimation. | |
Int | claimSemaphore (SemaphoreGroupPtr, Int, IntRef, IntRef, IntRef, Int) |
Called when the group is determined to be shared and a semaphore share is to be claimed. | |
Int | reclaimSemaphore (SemaphoreGroupPtr, Int) |
Called when a group wishes to let the CSA reclaim a semaphore share. | |
CSAGrpHeaderPtr | findGroup (IntCref, IntCref, CSAGrpHeaderPtr) |
Attempt to locate a specific group. | |
CSAGrpHeaderPtr | findAvailableGroup (IntCref, IntCref, CSAGrpHeaderPtr) |
Find open slot that fits count criteria. | |
CSAGrpHeaderPtr | subsetGroup (Int, CSAGrpHeaderPtr) |
Utility to clean CSA group tail. | |
CSAGrpHeaderPtr | combineGroup (Int, CSAGrpHeaderPtr) |
bool | isOriginator (void) const |
Int | getOriginatorId (void) const |
Int | canonicalUndefined (void) |
Static Protected Member Functions | |
static void | createAttachment (void) |
Factory for CSA. | |
static void | exitAttachment (void) |
On the way out from run-time. | |
Friends | |
class | CoreLinuxGuardPool |
This area is to communicate between address spaces when using one of the CoreLinux++ SemaphoreGroup types in public mode.
Int corelinux::SemaphoreCommon::getSemaphoreMaxValue | ( | SemaphoreGroupPtr | , | |
Int | ||||
) | [static] |
Returns the maximum value for a semaphore as defined by the original semaphore claimant.
SemaphoreGroup | pointer to group owner | |
Int | zero offset semaphore identifier |
void corelinux::SemaphoreCommon::groupDefined | ( | SemaphoreGroupPtr | ) | [static] |
When a shared semaphore group is created, it is updated in the CSA, either by increasing the count of processes accessing a particular group, or adding to the csa initially.
SemaphoreGroup | pointer |
Int corelinux::SemaphoreCommon::groupUnDefined | ( | SemaphoreGroupPtr | ) | [static] |
When the local process is deleting a semaphore group and it is considered a shared group, we are asked to adjust the map accordingly.
SemaphoreGroup | pointer to the group |
Int corelinux::SemaphoreCommon::setLock | ( | SemaphoreGroupPtr | , | |
Int | , | |||
Int | , | |||
Int | ||||
) | [static] |
Called by the base semaphore to aquire a lock for a specific semaphore.
SemaphoreGroup | pointer to the group | |
Int | the system group id | |
Int | the zero offset semaphore id | |
Int | the system dependent flag |
Int corelinux::SemaphoreCommon::setUnLock | ( | SemaphoreGroupPtr | , | |
Int | , | |||
Int | , | |||
Int | ||||
) | [static] |
Called by the base semaphore to relinquish a lock for a specific semaphore.
SemaphoreGroup | pointer to the group | |
Int | the system group id | |
Int | the zero offset semaphore id | |
Int | the system dependent flag |
Int corelinux::SemaphoreCommon::waitZero | ( | SemaphoreGroupPtr | , | |
Int | , | |||
Int | , | |||
Int | ||||
) | [static] |
Called by the base semaphore to wait for a specific semaphore to have a zero value.
SemaphoreGroup | pointer to the group | |
Int | the system group id | |
Int | the zero offset semaphore id | |
Int | the system dependent flag |
Int corelinux::SemaphoreCommon::obtainSemaphore | ( | SemaphoreGroupPtr | , | |
Int | , | |||
IntRef | , | |||
IntRef | , | |||
IntRef | , | |||
Int | ||||
) | [static] |
Typically called by a SemaphoreGroup prior to passing out the semaphore type to the caller.
SemaphoreGroup | the group pointer | |
Int | the semaphore identifier/index -1 = any | |
Int | reference the initial value (becomes the max if new) | |
Int | reference the recursive condition | |
Int | reference the balking condition | |
Int | 0 must not exist, 1 share, 2 must exist |
Int corelinux::SemaphoreCommon::relinquishSemaphore | ( | SemaphoreGroupPtr | , | |
Int | ||||
) | [static] |
Called when the semaphore is no longer being referenced.
Effectively reducing the share count for shared group semaphores
SemaphoreGroup | pointer | |
Int | the zero index semaphore identifier |
Int corelinux::SemaphoreCommon::setMaxValue | ( | SemaphoreGroupPtr | , | |
Int | , | |||
Int | ||||
) | [static] |
Called to set the semaphore maximum value.
For local this is SETVAL, for shared it is ignored
SemaphoreGroup | pointer | |
Int | the zero index semaphore identifier | |
Int | the value |
void corelinux::SemaphoreCommon::registerGroup | ( | SemaphoreGroupPtr | ) | [protected] |
Does the work of getting the group registered in the CSA.
SemaphoreGroup | pointer to register |
Int corelinux::SemaphoreCommon::deregisterGroup | ( | SemaphoreGroupPtr | ) | [protected] |
Does the work of reducing the group share count, or marking the group for reclaimation.
SemaphoreGroup | pointer to register |
Int corelinux::SemaphoreCommon::claimSemaphore | ( | SemaphoreGroupPtr | , | |
Int | , | |||
IntRef | , | |||
IntRef | , | |||
IntRef | , | |||
Int | ||||
) | [protected] |
Called when the group is determined to be shared and a semaphore share is to be claimed.
SemaphoreGroup | the group pointer | |
Int | the semaphore identifier/index -1 = any | |
Int | the initial value (becomes the max if new) | |
IntRef | the recursive condition | |
IntRef | the balking condition | |
Int | 0 must not exist, 1 share, 2 must exist |
Int corelinux::SemaphoreCommon::reclaimSemaphore | ( | SemaphoreGroupPtr | , | |
Int | ||||
) | [protected] |
Called when a group wishes to let the CSA reclaim a semaphore share.
SemaphoreGroup | the group pointer | |
Int | the semaphore identifier/index |