Next Previous Up Top Contents Index

4.6.4 Exclusive locks

<exclusive-lock>

Open abstract instantiable class

Summary

The class of locks which prohibit unlocking by threads that do not own the lock.

Superclasses

<lock>

Library

threads

Module

threads

Description

The class of locks which prohibit unlocking by threads that do not own the lock.

The notion of ownership is directly supported by the class, and a thread can test whether an <exclusive-lock> is currently owned. An instance of <exclusive-lock> can only be owned by one thread at a time, by calling wait-for on the lock.

Once owned, any attempt by any other thread to wait for the lock will cause that thread to block. It is an error for a thread to release an <exclusive-lock> if another thread owns it.

<exclusive-lock> has no direct instances; calling make on <exclusive-lock> returns an instance of <simple-lock>.

Operations

The class <exclusive-lock> provides the following operations:

owned?
Tests to see if the lock has been claimed by the current thread.

Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index