Index

Package: Locking_Objects

Description

package Locking_Objects is

Tasks & Protected

Locking_Object (protected type)

Entries:Lock, Unlock
A simple protected object used to implement a lock mutex.

Types

A_Locking_Object

type A_Locking_Object is access all Locking_Object;

Constants & Global variables

LOCK_USE_EXCEPTION

LOCK_USE_EXCEPTION : exception;
raised on improper use of a Locking_Object

Subprograms & Entries

Locking_Object. Lock (abstract)

entry Lock
( owner: Task_Id := Current_Task );
Takes the lock. The calling thread will block until the lock is free. This must not be called again by the caller until it calls Unlock.

Locking_Object. Unlock

procedure Unlock;
Immediately releases the lock. Only the thread that has first called Lock should call Unlock. Raises LOCK_USE_EXCEPTION if the lock is being used illegally.

Delete

procedure Delete is new Ada.Unchecked_Deallocation
( Locking_Object, A_Locking_Object );
Deletes a Locking_Object.