根据同样的思路,您应该将设备锁文件之类的锁文件放置在 /var/lock 中。
In a similar vein, you should place lock files for things like device lock files in /var/lock.
例如,在撰写本文的过程中,我发现有几次我的设备会启用屏幕锁,但是触摸屏不会正常工作,所以我就不能解锁。
During the writing of this article, for instance, I found that a few times the screen lock would enable on my device, but the touchscreen would not work properly, so I would not be able to unlock it.
还有另外一种情况:你的驱动程序正在执行并且获得了一个锁来控制对其设备的访问操作。
Here's another scenario: your driver is executing and has just taken out a lock that controls access to its device.
应用推荐