Lock Service
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ロック
このサービスを使用すると、スクリプトでコードのセクションへの同時アクセスを防ぐことができます。これは、複数のユーザーまたはプロセスが共有リソースを変更し、競合を回避する必要がある場合に便利です。
クラス
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],["The service provides a mechanism to prevent concurrent code access, crucial for shared resource modification. `LockService` offers methods like `getDocumentLock`, `getScriptLock`, and `getUserLock` to acquire different types of locks. The `Lock` class manages the lock itself, with methods like `hasLock` to check if a lock has been obtained, `releaseLock` to release it, and `tryLock` and `waitLock` to acquire a lock with a timeout.\n"],null,[]]