Semaphore Property (ASystem)

version 8

Returns a semaphore object which can be used to control access to shared resources.

Syntax

[ ob = ] Object.Semaphore ( )

The Parameters property syntax has the following parts:

 

Name

Type

Description

Object

ASystem

ASystem object

ob

ASemaphore

Semaphore object

Comments

The Semaphore property can be used to synchronize access to a system resource when running multiple UUTs in parallel mode or when using multi-threads to access the resource. If using it to synchronize between different process set the name of the semaphore to a unique system wide from both process.

Example

The following example locks the System before calling the function (PerformSomethingProtected). If the semaphore already locked by another thread, the lock method will wait until unlocked (from the other thread) and then call the function.

System.Semaphore.Lock()

System.PerformSomethingProtected()

System.Semaphore.Unlock()

Applies to

ADriver, AProgram, ASystem

See Also

ADriver.Semaphore, AProgram.Semaphore