[trivial] [website] Add a link to Locked from Synchronized.

This commit is contained in:
Reinier Zwitserloot committed 2023-09-25 06:30:21 +02:00
1 parent ca58ce0757
commit d328ec35c1
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>