With locking, if one thread attempts to acquire a lock that is already held by another thread, the thread will block until the lock becomes available.
使用锁定,如果一个线程试图获取其他线程已经具有的锁定,那么该线程将被阻塞,直到该锁定可用。
And depending on what other optimizations are enabled by the larger basic block, the duration for which the lock is held may not even be lengthened under coarsening.
而且根据更大的基本块支持其他何种优化,在粗化的情况下,持有锁的时间甚至可能不会延长。
This synchronized code block acquires the lock associated with the customer class object before it executes.
同步的代码块在执行之前需要与客户类对象相关的锁。
应用推荐