Does making a Reentrant Lock static and make it a mutex?
问题 In Brian Goetz's book, Java Concurrency in Practice, his example of a Reentrant lock is programmed like this: Lock lock = new ReentrantLock(); However, I am curious to know if changing the above code to: private static final Lock lock = new ReentrantLock(); causes the lock to now act as a mutex, or if it is unnecessary and redundant. Thus, does the functionality of this code change if the lock is made private, static, and final? lock.lock(); try { //method stuff } finally { lock.unlock(); }