|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
image.haslock - Function
1.1.1 Does this image have any locks set?
Description
This function can be used to find out whether the image has a read or a write
lock set. It is not of general user interest. It returns a vector of Booleans of
length 2. Position 1 says whether a read lock is set, position 2 says whether a
write lock is set.
In general locking is handled automatically, with a built in lock release cycle. However, this function can be useful in scripts when a file is being shared between more than one process. See also functions unlock and lock.
Arguments
boolArray
Example
"""
#
print "\t----\t haslock Ex 1 \t----"
ia.maketestimage(’xx’,overwrite=true)
ia.lock(writelock=T)
print ia.haslock()
#[True, True]
ia.unlock()
print ia.haslock()
#[False, False]
ia.lock(F)
print ia.haslock()
#[True, False]
ia.close()
#
"""
This example acquires a read/write lock on the file and then unlocks it
and acquires just a read lock.
__________________________________________________________________
More information about CASA may be found at the
CASA web page
Copyright © 2016 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search