aryLock

Lock an array for exclusive use by the current thread

Description:

This function locks an ARY array for use by the current thread. An array can be locked for read-only access or read-write access. Multiple threads can lock an array simultaneously for read-only access, but only one thread can lock an array for read-write access at any one time. Use of any ARY function that may modify any aspect of the array - either the data values stored in the array or the meta-data describing the whole array - will fail with an error unless the thread has locked the array for read-write access. Use of an ARY function that cannot modify the array will fail with an error unless the thread has locked the array (in this case the lock can be either for read-only or read-write access).

If " readonly" is zero (indicating the current thread wants to modify some aspect of the array), this function will report an error if any other thread currently has a lock (read-only or read-write) on the array.

If " readonly" is non-zero (indicating the current thread wants read-only access to the array), this function will report an error only if another thread currently has a read-write lock on the array.

The current thread must unlock the array using datUnlock before it can be locked for use by another thread. All arrays are initially locked by the current thread when they are created or opened. The type of access available to the array (" Read" , " Write" or " Update" ) determines the type of the initial lock. For pre-existing arrays, this is determined by the access mode specified when it is first opened. For new and temporary arrays, the initial lock is always a read-write lock.

Invocation

aryLock( Ary ary, int readonly, int status );

Notes:

Parameters :

ary
Pointer to the array that is to be locked.
readonly
If non-zero, the array is locked for read-only access. Otherwise it is locked for read-write access.
status = int (Given and Returned)
Pointer to global status.