共用方式為


LinkedBlockingQueue.RemainingCapacity Method

Definition

Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking.

[Android.Runtime.Register("remainingCapacity", "()I", "GetRemainingCapacityHandler")]
public virtual int RemainingCapacity ();
[<Android.Runtime.Register("remainingCapacity", "()I", "GetRemainingCapacityHandler")>]
abstract member RemainingCapacity : unit -> int
override this.RemainingCapacity : unit -> int

Returns

Implements

Attributes

Remarks

Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking. This is always equal to the initial capacity of this queue less the current size of this queue.

Note that you <em>cannot</em> always tell if an attempt to insert an element will succeed by inspecting remainingCapacity because it may be the case that another thread is about to insert or remove an element.

Java documentation for java.util.concurrent.LinkedBlockingQueue.remainingCapacity().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to