newObjects ActiveX Pack1 Semaphore
 

See also object creation information - ClassID/ProgID 

Overview | Reference

Overview

Semaphore object.  

Reference

method.gif (107 bytes) Create Syntax:
object.Create([ max [, initial [, name]]])

Initializes the Semaphore. Must be called first.

max - maximum count for the semaphore. Default is 1 (long integer - must be positive)

initial - the initial count of the semaphore (must be 0 to max). Default is 1.

name - name of the Semaphore, default is unnamed (empty string does the same).

method.gif (107 bytes) ReleaseSemaphore Syntax:
object.ReleaseSemaphore([inc])

Releases the semaphore object and increments its count by the specified amount.

inc - long integer, must be positive. Default is 1.

method.gif (107 bytes) Wait Syntax:
b = object.Wait([timeout])

Waits the specified time to obtain the Semaphore object.

Returns: True if the wait operation is successful and False if the Timeout has been exceeded.

timeout - (long) milliseconds to wait. Default is infinite (-1).

Wait succeeds when the semaphore has count greater than 0. In such case after successful Wait the count is decreased by 1.

IsActive Syntax:
b = object.IsActive

This is 0 milliseconds Wait shortcut - see wait for more information.

...

newObjects Copyright 2001-2006 newObjects [ ]