OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

4.6.7 Lock test

A lock test (DC_LCK_TEST set in flags) is executed to decide whether lock can be specified for a resource by using the function dc_lck_get() (which puts resources under lock). In this case, the function dc_lck_get() terminates normally without putting the resource under lock (even when the resource can be put under lock). If the specified resource cannot be shared because it is lockly used by another UAP, the function dc_lck_get() returns with an error (DCLCKER_WAIT (00450)) regardless of whether waiting for release from lock is specified. Other return values for lock tests are listed below. Errors such as a deadlock, timeout, and insufficient memory are not returned. Lock migration is not generated.

Organization of this subsection
(1) Notes on executing lock tests

(1) Notes on executing lock tests

Execute a lock test to check whether the resource can be put under lock. Even if a lock test terminates normally, this normal termination does not ensure that the subsequent lock requests will terminate normally. Also, even is a lock test terminates normally, the resource is not actually shut down. Thus, if the dc_lck_release_all() or dc_lck_release_byname() (which releases resources from lock) is called after the normal termination of a lock test, the function returns with an error.