Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

Unlock

変数名で論理ロックを解除します。

Synopsis

Unlock(varname)

引数

varname アンロックする変数の名前。

概要

varname でロックが取得されるたびに、ロック・カウントがインクリメントされます。Unlock は、このカウントをデクリメントします。ロック・カウントが 0 になったときだけ、論理ロックは解除されます。このため、Lock への呼び出しは対応する Unlock への呼び出しと調整しなければなりません。

以下の例では、Lock 関数を使用してグローバル変数名 (glvn) で論理ロックを取得し、次に Unlock 関数を使用して論理ロックを解除します。タイムアウト値は 10 秒に指定されています。

If Lock(^PatientData(PatientID),10) = True Then
  Println "Got the Lock"
  Unlock(^PatientData(PatientID))     'Release the logical lock
Else
  Println "Couldn't get the lock"
End If

関連項目

FeedbackOpens in a new tab