Product Documentation
Virtuoso Studio Design Environment SKILL Reference
Product Version IC23.1, November 2023

ddLockSet

ddLockSet( 
b_lockId 
t_mode 
[ t_block ] 
[ t_message ] 
) 
=> t / nil 

Description

Gets the type of lock in t_mode for the file ID. If you have already locked the file, this function changes the lock type.

This function uses the Cadence locking system (CLS) instead of cdsd.

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 it using cdsdAdmin. Defaults to NULL.

Value Returned

t

The lock was obtained, or b_blockId was the type of lock that you already had on the file.

nil

The lock was not obtained.

Example

ddLockSet( myFileLock "r" nil "Test lock" ) => t 

Return to top
 ⠀
X