AbstractQueuedLongSynchronizer.ConditionObject.Await 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Await() |
實現可中斷狀態等待。 |
| Await(Int64, TimeUnit) |
實施定時等待條件。 |
Await()
實現可中斷狀態等待。
[Android.Runtime.Register("await", "()V", "")]
public void Await();
[<Android.Runtime.Register("await", "()V", "")>]
abstract member Await : unit -> unit
override this.Await : unit -> unit
實作
- 屬性
例外狀況
備註
實現可中斷狀態等待。
<ol><li>如果目前執行緒被中斷,請拋出 InterruptedException。
<Li>儲存鎖定狀態 由 #getState返回。
<用已儲存狀態作為參數的 Invoke>#release,失敗時拋出 IllegalMonitorStateException。
<直到>有信號或中斷為止。
<li>透過調用帶有儲存狀態的 #acquire 專用版本作為參數重新獲得。
<li>如果在第 4 步被阻擋時被中斷,請拋出 InterruptedException。
</ol>
Java 文件 java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject.await()。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Await(Int64, TimeUnit)
實施定時等待條件。
[Android.Runtime.Register("await", "(JLjava/util/concurrent/TimeUnit;)Z", "")]
public bool Await(long time, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("await", "(JLjava/util/concurrent/TimeUnit;)Z", "")>]
abstract member Await : int64 * Java.Util.Concurrent.TimeUnit -> bool
override this.Await : int64 * Java.Util.Concurrent.TimeUnit -> bool
參數
- time
- Int64
等待時間最長
- unit
- TimeUnit
論證的時間 time 單位
傳回
false如果等待時間明顯超過後才會從此方法返回;否則,。 true
實作
- 屬性
例外狀況
備註
實施定時等待條件。
<ol><li>如果目前執行緒被中斷,請拋出 InterruptedException。
<Li>儲存鎖定狀態 由 #getState返回。
<用已儲存狀態作為參數的 Invoke>#release,失敗時拋出 IllegalMonitorStateException。
<在被打燈、中斷或被罰時之前,一直>封鎖。 <li>透過調用帶有儲存狀態的 #acquire 專用版本作為參數重新獲得。
<li>如果在第 4 步被阻擋時被中斷,請拋出 InterruptedException。
<li>如果在第 4 步被阻擋時超時,回傳 false,否則為 true。
</ol>
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。