Double check locking

From zakirkun/ice-tea · View interactive version

Double check locking is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects broken double-checked locking implementations that create race conditions in singleton initialization.

How to use this skill

Skill file

Double-Checked Locking Race Condition

Overview

Double-checked locking is a common but often incorrectly implemented pattern for lazy singleton initialization. Without proper memory ordering or volatile declarations, the second check can observe a partially-initialized object due to instruction reordering.

In Java pre-5.0 (without volatile), this is broken. In Go, use sync.Once instead.

Remediation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.