aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2009-09-09 18:46:52 +0000
committerdan <dan@noemail.net>2009-09-09 18:46:52 +0000
commit11b3879b18d48d6a06f71fcbef0edca17ca31268 (patch)
tree93889995b770505e295c95068bb890f0b190b999 /src/os_unix.c
parent3f022189dd7baca7c89c62f9c154067da2c389c0 (diff)
downloadsqlite-11b3879b18d48d6a06f71fcbef0edca17ca31268.tar.gz
sqlite-11b3879b18d48d6a06f71fcbef0edca17ca31268.zip
Trying to open a transaction in one thread and close it in another is a misuse with LinuxThreads. Doing so may cause memory and file-descriptors to be leaked. Update an assert() and some test cases to account for this.
FossilOrigin-Name: ef99eb57c536d82e7c19fd3d990c17793cc64a3f
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 9b6afe537..a45aaa1d7 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -925,7 +925,15 @@ static void releaseOpenCnt(struct unixOpenCnt *pOpen){
assert( pOpen->pNext->pPrev==pOpen );
pOpen->pNext->pPrev = pOpen->pPrev;
}
- assert( !pOpen->pUnused );
+ assert( !pOpen->pUnused || threadsOverrideEachOthersLocks==0 );
+
+ /* If pOpen->pUnused is not null, then memory and file-descriptors
+ ** are leaked.
+ **
+ ** This will only happen if, under Linuxthreads, the user has opened
+ ** a transaction in one thread, then attempts to close the database
+ ** handle from another thread (without first unlocking the db file).
+ ** This is a misuse. */
sqlite3_free(pOpen);
}
}