Share via


Reference.IsEnqueued Property

Definition

Tests if this reference object is in its associated queue, if any.

public virtual bool IsEnqueued { [Android.Runtime.Register("isEnqueued", "()Z", "GetIsEnqueuedHandler")] get; }
[<get: Android.Runtime.Register("isEnqueued", "()Z", "GetIsEnqueuedHandler")>]
member this.IsEnqueued : bool

Property Value

true if and only if this reference object is in its associated queue (if any).

Attributes

Remarks

Tests if this reference object is in its associated queue, if any. This method returns true only if all of the following conditions are met: <ul> <li>this reference object was registered with a queue when it was created; and <li>the garbage collector has added this reference object to the queue or #enqueue() is called; and <li>this reference object is not yet removed from the queue. </ul> Otherwise, this method returns false. This method may return false if this reference object has been cleared but not enqueued due to the race condition.

This member is deprecated. This method was never implemented to test if a reference object has been cleared and enqueued as it was previously specified since 1.2. This method could be misused due to the inherent race condition or without an associated ReferenceQueue. An application relying on this method to release critical resources could cause serious performance issue. An application should use ReferenceQueue to reliably determine what reference objects that have been enqueued or refersTo(null) to determine if this reference object has been cleared.

Java documentation for java.lang.ref.Reference.isEnqueued().

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