English 中文(简体)
NSPR锁带有超时时间
原标题:
  • 时间:2009-01-22 14:13:06
  •  标签:

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.

问题回答

我自己没有使用这个库,但是大多数等待通常都有超时时间。

但是,我快速检查了文档后,发现在 PRLock 中有这样的内容:“获取锁不是可中断的操作,也没有任何超时机制”。。

链接





相关问题
热门标签