有两种类型的 非递归锁:快的和慢的。
可以通过两种方式(递归地或非递归地)的其中一种来请求锁。
A lock can be acquired in one of two ways, recursively or non-recursively.
如果锁是以递归方式被请求,那么发出请求的线程已经持有了它。
If a lock is acquired recursively, the requesting thread already owns it.
当调用如果线程已持有锁,增量递归层次一,并返回。如果线程没有等待直到主人锁释放锁。
When invoked if this thread already owns the lock, increment the recursion level by one, and return immediately. if thread doesn't own the lock it waits until owner release lock.
当调用如果线程已持有锁,增量递归层次一,并返回。如果线程没有等待直到主人锁释放锁。
When invoked if this thread already owns the lock, increment the recursion level by one, and return immediately. if thread doesn't own the lock it waits until owner release lock.
应用推荐