QT Class RadLock

 

Overview

The RadLock class is the principal tool for performing cross workspace asynchronous Mutex locks. The RadSLock is one of the key words accepted by the qt new: function. There can be many RadLock objects.

new

Overview

The new function creates a new RadLock object and returns a pointer to the newly created object. The RadLock is one of the class key words accepted by the qt new: function. There can be many RadLock objects.

 

Syntax

(qt new: RadLock:)

Arguments

RadLock:The RadLock keyword.
radLockPtrAlways returns a pointer to the new object.

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a new RadLock object
(setq r (qt radLockPtr: lock:)) ;; Returns true when the lock occurs

delete

Overview

The delete function destroys a RadLock object and returns a null pointer.

 

Syntax

(qt delete: radLockPtr)

Arguments

radLockPtrThe pointer to the radLockPtr object to be destroyed.
nullPtrAlways returns a null pointer.

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a RadLock object.
(setq radLockPtr (qt delete: radLockPtr)) ;; Destroy the RadLock object.

lock

Overview

The RadLock lock function locks the Mutex lock in the workspace.

 

Syntax

(qt radLockPtr lock:)

Arguments

result Always returns true when the lock occurs

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a new RadLock object
(setq r (qt radLockPtr: lock:)) ;; Returns true when the lock occurs
(setq r (qt radLockPtr: unlock:)) ;; Returns true when the unlock occurs

trylock

Overview

The RadLock trylock function attempts to lock the Mutex lock in the workspace. If the Mutex cannot be locked, the trylock function returns false.

 

Syntax

(qt radLockPtr trylock:)

Arguments

result Always returns true when the lock occurs or false if the lock cannot be made.

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a new RadLock object
(setq r (qt radLockPtr: trylock:)) ;; Returns true when the lock occurs or false if the lock cannot occur.
(setq r (qt radLockPtr: unlock:)) ;; Returns true when the unlock occurs

 

Syntax

(qt radLockPtr trylock: timeout)

Arguments

timeout The number of milliseconds to try locking before returning.
result Always returns true when the lock occurs or false if the lock cannot be made.

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a new RadLock object
(setq r (qt radLockPtr: trylock: 1000)) ;; Returns true when the lock occurs or false if the lock cannot occur.
(setq r (qt radLockPtr: unlock:)) ;; Returns true when the unlock occurs

unlock

Overview

The RadLock unlock function unlocks the Mutex lock in the workspace.

 

Syntax

(qt radLockPtr unlock:)

Arguments

result Always returns true when the unlock occurs

 

Example

(setq radLockPtr (qt new: RadLock:)) ;; Create a new RadLock object
(setq r (qt radLockPtr: lock:)) ;; Returns true when the lock occurs
(setq r (qt radLockPtr: unlock:)) ;; Returns true when the unlock occurs