mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 18:15:55 +00:00
[trivial] [website] Add a link to Locked from Synchronized.
This commit is contained in:
1 file changed
+2
@@ -9,6 +9,8 @@
|
||||
If you want, you can create these locks yourself. The <code>$lock</code> and <code>$LOCK</code> fields will of course not be generated if you already created them yourself. You can also choose to lock on another field, by specifying it as parameter to the <code>@Synchronized</code> annotation. In this usage variant, the fields will not be created automatically, and you must explicitly create them yourself, or an error will be emitted.
|
||||
</p><p>
|
||||
Locking on <code>this</code> or your own class object can have unfortunate side-effects, as other code not under your control can lock on these objects as well, which can cause race conditions and other nasty threading-related bugs.
|
||||
</p><p>
|
||||
If you would prefer <code>java.util.concurrent.locks</code> style locks (recommended if you're using virtual threads), have a look at <a href="Locked"><code>@Locked</code></a>.
|
||||
</p>
|
||||
</@f.overview>
|
||||
|
||||
|
||||
Reference in new issue
Block a user