1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Add the xInMutex method to the os-layer switch for testing whether or not

mutexes are used correctly. (CVS 2851)

FossilOrigin-Name: a582b159595ff8d31c81e9b3044711d6590d3f0e
This commit is contained in:
drh
2006-01-02 20:00:12 +00:00
parent 35a5965a17
commit 88f474a938
5 changed files with 37 additions and 13 deletions

View File

@@ -1586,6 +1586,16 @@ static void unixLeaveMutex(){
#endif
}
/*
** Return TRUE if we are currently within the mutex and FALSE if not.
** This routine is intended for sanity checking only. It is designed
** for use in an assert() to verify that the mutex is held or not held
** in certain routines.
*/
static int unixInMutex(){
return inMutex;
}
/*
** This function is called automatically when a thread exists to delete
** the threads SqliteTsd structure.
@@ -1706,6 +1716,7 @@ struct sqlite3OsVtbl sqlite3Os = {
unixCurrentTime,
unixEnterMutex,
unixLeaveMutex,
unixInMutex,
unixThreadSpecificData,
genericMalloc,
genericRealloc,