lock.lock();获取锁,如被锁定则等待
lock.tryLock();如未被锁定才获取锁
lock.tryLock(long timeout, TimeUnit unit);获取锁,如已被锁定,则最多等待timeout时间后返回获取锁状态
lock.lockInterruptibly();如当前线程未被interrup才获取锁.
lock.lock();获取锁,如被锁定则等待
lock.tryLock();如未被锁定才获取锁
lock.tryLock(long timeout, TimeUnit unit);获取锁,如已被锁定,则最多等待timeout时间后返回获取锁状态
lock.lockInterruptibly();如当前线程未被interrup才获取锁.