SQL_LockDatabase Function

Locks a database so threading operations will not interrupt.

If you are using a database Handle for both threading and non-threading, this MUST be called before doing any set of non-threading DB operations. Otherwise you risk corrupting the database driver's memory or network connection.

Leaving a lock on a database and then executing a threaded query results in a dead lock! Make sure to call SQL_UnlockDatabase()!

If the lock cannot be acquired, the main thread will pause until the threaded operation has concluded.

Care should be taken to not lock an already-locked database. Internally, lock calls are nested recursively and must be paired with an equal amount of unlocks to be undone. This behaviour should not be relied on.

void SQL_LockDatabase(Handle database)

Parameters

Handle database

A database Handle.

Errors

Invalid database Handle.