> This works on some systems but not on others. On some > versions of Linux, a thread is not able to override locks > created by a different thread in the same process. When > that happens, a database connection created on one thread > will not be usable by a different thread.
This is not the point here because the file lock should be released to allow the previous OsFile->tid to be reset (this is my case). (i forgot this from the enhancement...) 1: - "sqlite3_release" function. It checks the lock state of files. If all is clear, set OsFile->tid to 0. return the state. 1-bis: - "sqlite3_release" function. It checks the lock state of files. If something is locked, it releases transactions/file locks and finally set OsFile->tid to 0. 2: - Atomically, a thread try to 'CHECK_THREADID' in sqlite3OsLock and if the OsFile->tid eq 0, just call SET_THREADID. Best regards, -- Guillaume FOUGNIES Eulerian Technologies