[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

FailsafeSemaphore

inherits from Semaphore

Object <- FixedList <- ObjectList <- Semaphore <- FailsafeSemaphore



Operations

Get list of all operations

Access
Finalize
Init
ReinitializeClass
Release
ReleaseFailsafe


Attributes

Get list of all attributes

Class FailsafeSemaphore defines no new attributes.


Fields

Field Type
Semaphore: releaseCount: Signed
FailsafeSemaphore: actor: Actor


Instance template

instance FailsafeSemaphore tag;
   releaseCount: 0;
          actor: nilObject;
end instance;

Class definition

//
// FailsafeSemaphores release even if the actor that has one accessed but
// is not blocked on it gets destroyed. This guarantees that code waiting for
// a semaphore will run regardless of the time window in which actors are destroyed.
//
Define Class FailsafeSemaphore;
    inherits from Semaphore;

    field actor: Actor, weak;
    
    class operation ReleaseFailsafe(actor: Actor);
        // release any semaphores accessed by this actor

    overrides ReinitializeClass, Init, Finalize;
    overrides Access, Release;
end class;