SQLITE3_MUTEX_HELD(3) | Library Functions Manual | SQLITE3_MUTEX_HELD(3) |
sqlite3_mutex_held
,
sqlite3_mutex_notheld
—
sqlite3_mutex_held
(sqlite3_mutex*);
int
sqlite3_mutex_notheld
(sqlite3_mutex*);
These routines should return true if the mutex in their argument is held or not held, respectively, by the calling thread.
The implementation is not required to provide versions of these routines that actually work. If the implementation does not provide working versions of these routines, it should at least provide stubs that always return true so that one does not get spurious assertion failures.
If the argument to sqlite3_mutex_held() is a NULL pointer then the routine should return 1. This seems counter-intuitive since clearly the mutex cannot be held if it does not exist. But the reason the mutex does not exist is because the build is not using mutexes. And we do not want the assert() containing the call to sqlite3_mutex_held() to fail, so a non-zero return is the appropriate thing to do. The sqlite3_mutex_notheld() interface should also return 1 when given a NULL pointer.
December 19, 2018 | NetBSD 9.0 |