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.
然后我们可以在45秒内向用户报告错误。
我该怎么做?
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.