From b7626403f05545785fcf6522093c1b370fc9c801 Mon Sep 17 00:00:00 2001 From: dragonfsky Date: Mon, 29 Jun 2026 07:39:28 +0800 Subject: [PATCH] Fix Atomic lock README example --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f53006..8c18031 100644 --- a/README.md +++ b/README.md @@ -42,15 +42,14 @@ Here is how you can use a lock: ```java Locks locks = sttc.locks(); Lock lock = locks.get("test-lock"); -new Atomic(lock).call( - new Callable() { - @Override - public void call() { - // perfectly synchronized code - return null; - } +Callable work = new Callable() { + @Override + public Void call() { + // perfectly synchronized code + return null; } -); +}; +new Atomic(work, lock).call(); ``` ## How to Contribute