Lock an array for exclusive use by the current thread
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.
If the version of HDS being used does not support object locking, this function will return without action unless the HDS tuning parameter V4LOCKERROR is set to a non-zero value, in which case an error will be reported.
An error will be reported if the supplied array is currently locked by another thread.
The majority of ARY functions will report an error if the array supplied to the function has not been locked for use by the calling thread. The exceptions are the functions that manage these locks - aryLock, datUnlock and aryLocked.
Attempting to lock an array that is already locked by the current thread will change the type of lock (read-only or read-write) if the lock types differ, but will otherwise have no effect.