Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbIsLockActive

Indicates if session-wide record locking is currently active.

Declaration

CTBOOL ctdbIsLockActive(CTHANDLE Handle)

Description

ctdbIsLockActive() indicates if session-wide record locking is currently active. Session-wide record locking is active/enabled if a call to ctdbLock(), with one of the READ or WRITE segment mode variations, has been made. The lock active flag is cleared with a call to ctdbUnlock() or with a call to ctdbLock() with the lock mode set to CTLOCK_FREE or CTLOCK_SUSPEND. Ending a transaction via calls to ctdbCommit() or ctdbUnlock() will also clear the lock active flag. This function does not verify if a call to ctdbLockRecord() was made because ctdbIsLockActive() does not check the lock status of individual records. To do that, use ctdbGetRecordLock().

  • Handle [in] the Session or any other Handle.

Returns

ctdbIsLockActive() returns YES if the session-wide record locking mode is one of the READ or WRITE variations, NO otherwise.

Example


if (ctdbIsLockActive(pSession))

ctdbUnlock(pSession);

See also

ctdbLock(), ctdbUnlock(), ctdbGetLockMode(), ctdbLockRecord(), Locking

TOCIndex