Core concept
synchronized void inc() { count++; }
synchronized (obj) { /* critical */ }Advertisement
How it works
Cannot interrupt. Not timeout-able. Pin virtual threads.
Advertisement
Trade-offs + gotchas
Simple cases. Legacy code.
synchronized void inc() { count++; }
synchronized (obj) { /* critical */ }Cannot interrupt. Not timeout-able. Pin virtual threads.
Simple cases. Legacy code.