synchronized lock reentrantLock 区别

1. synchronized 实现悲观锁,能够自动释放锁ant

2. lock reentrantLock 须要手动释放锁,可中途释放锁sync

相关文章
相关标签/搜索