Lock Service
锁定
借助此服务,脚本可以防止对代码段进行并发访问。如果有多个用户或进程修改共享资源,并且您希望防止冲突,这将非常有用。
类
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-02。
[null,null,["最后更新时间 (UTC):2024-12-02。"],[[["The Lock service in Apps Script helps prevent conflicts when multiple users or processes access shared resources."],["It provides different types of locks: Document Lock, Script Lock, and User Lock, each controlling access at various levels."],["Locks can be acquired, released, and checked for status using methods like `tryLock`, `releaseLock`, and `hasLock`."],["Timeouts can be set while acquiring locks to avoid indefinite waiting using methods like `tryLock` and `waitLock`."]]],[]]