I am using NSPR as my cross-platform threading library and using these locks: PRLock and PRRWLock. I want a timeout in the lock functions. So that, it should wait for 45 seconds, and if it is not able to acquire a lock within that time, the call should come out with an error.
Then we can report error to the user within 45 seconds.
How can I do it?
Actually I am doing some SQLite operation inside a lock, and sometimes that take long time to complete, if the database is large (~1.9 GB). I want to come up with error to the user that time, if acquiring lock fails. Please help.