Carapace

CriticalSection Class

A CritcalSection is like an un-named Lock. The operating system guarantees not to interrupt a piece of code protected by a CriticalSection.

Unlike a Lock, you do not supply a time limit when requesting critical section.

CriticalSection Creation

The create function is used to create a Lock. The following creates an un-named lock:

    (create CriticalSection)
If this CriticalSection object is shared between threads, it can be used by those threads to synchronise access to another shared resource.

CriticalSection Properties

None.

CriticalSection Methods

method name description
lock take the lock -- so that no other thread can take it
unlock release the lock -- so that another thread can take it


lock

Take the lock -- so that no other thread can take it.

Arguments: none.

Return type: the empty List ()


unlock

Release the lock -- so that another thread can take it.

Arguments: none

Return type: the empty List ()


Contents Current topic: objects Related links: built-in objects


Contents Index Current topic: objects Related links: built-in objects