/** * 设置当前独占访问的线程,参数为null代表没有线程可以独占访问。 * This method does not otherwise impose any synchronization or * volatile field accesses. * @param thread the owner thread */ protectedfinalvoidsetExclusiveOwnerThread(Thread thread){ exclusiveOwnerThread = thread; }
/** * 返回最新的通过setExclusiveOwnerThread方法设置的的线程,或者在从未设置过的情况下返回null * This method does not otherwise impose any synchronization or volatile field accesses. * @return the owner thread */ protectedfinal Thread getExclusiveOwnerThread(){ return exclusiveOwnerThread; } }
This is copyright.