Gaining exclusive access to a B Tree file

#include "btree.h"

int btlock(BTA* btact);

The btlock function enables a process to gain exclusive access to a B Tree file, originally opened in shared mode. btlock is passed btact, which holds the context pointer of the file for which exclusive access is required.

btlock will return zero on success, error code otherwise. Applications should be ready to handle a QBUSY error return, indicating that exclusive access could not be gained. btlock waits for ZSLEEP seconds before giving up the attempt to gain exclusive access. ZSLEEP is an implementation defined constant. The default is five seconds.