語言

ReentrantReadWriteLock.ReentrantWriteLock.HoldCount 屬性

定義

查詢目前執行緒對此寫入鎖的hold數。

public virtual int HoldCount { [Android.Runtime.Register("getHoldCount", "()I", "GetGetHoldCountHandler")] get; }
[<get: Android.Runtime.Register("getHoldCount", "()I", "GetGetHoldCountHandler")>]
member this.HoldCount : int

屬性值

當前執行緒對此鎖的hold數,若未被當前執行緒持有,則為零

屬性

備註

查詢目前執行緒對此寫入鎖的hold數。 線程對每個鎖定動作都保留一個鎖,而該動作與解鎖動作不符。 在效果上與 ReentrantReadWriteLock#getWriteHoldCount相同。

新增於1.6版本。

Java 文件 java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock.getHoldCount()。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於