Name

sqlite3_mutex_try() — Attempt to acquire a mutex lock

Definition

int sqlite3_mutex_try( sqlite3_mutex* mutex );
mutex

A mutual exclusion lock.

Returns

The value SQLITE_OK is returned if the lock was acquired. Otherwise, SQLITE_BUSY will be returned.

Description

This function attempts to acquire a mutual exclusion lock for the current thread. If the lock is acquired, SQLITE_OK will be returned. If the lock is held by another thread, SQLITE_BUSY will be returned. If a NULL mutex pointer is passed in, the function will return SQLITE_OK.

This function is not supported by all threading libraries. If SQLite has thread support, but this function is not supported, a valid mutex will always result in an SQLITE_BUSY return code.

See Also

sqlite3_mutex_enter(), sqlite3_mutex_leave()