ddLockSetEx
ddLockSetEx(
b_lockId
t_mode
[ g_block ]
[ t_message ]
[ g_doErrMsgs]
[ g_timeout ]
)
=> t / nil
Description
An extension of ddLockSet with two additional arguments.
Arguments
|
b_lockId
|
The lock ID as returned by ddLockPath.
|
|
t_mode
|
The lock type you want. Valid values: l, r, w, and e
-
l (link)
while you have a copy in memory.
The new Cadence locking system (CLS) does not have link locks. Therefore, if you specify l, you will not get a lock. -
r (read)
while you are in the process of reading from disk. -
w (write)
when you want to write a file. You cannot obtain this lock if anyone else is reading from disk or has a Write lock. -
e (exclusive)
when you want to delete the file. You cannot obtain this if anyone has a Link, Read, or Write lock.
|
|
g_block
|
When set to t (default), ddLockSet does not return until you get the lock you have requested. When set to nil, ddLockSet returns at once, whether or not it gets the lock. But you need to loop repeatedly calling ddLockSet until the process, which has the lock and is preventing you from getting yours, frees it.
|
|
t_message
|
A string you can set to explain why you want the lock, so other users will see the information. The default is NULL.
|
|
g_doErrMsgs
|
When t, warnings are reported.
|
|
g_timeout
|
Time out in seconds after which the function will quit trying to get a lock on the file if the g_block argument is t and another process has the lock.
|
Value Returned
|
t
|
The lock was obtained.
|
|
nil
|
The lock was not obtained.
|
Example
view1master = ddGetObj("lib1" "cell1" "view1" "master.tag")
view1masterpath = ddGetObjReadPath(view1master)
lockId = ddLockPath(view1masterpath)
gotLock = ddLockSetEx(lockId "w" t "proc1 lock" t 60.0)
ddLockSetEx() will time out after 60 seconds if another process has the lock on file master.tag
Related Topics
ddLockSet
Return to top