Partager via


Message.Asynchronous Property

Definition

Returns true if the message is asynchronous, meaning that it is not subject to Looper synchronization barriers. -or- Sets whether the message is asynchronous, meaning that it is not subject to Looper synchronization barriers.

public bool Asynchronous { [Android.Runtime.Register("isAsynchronous", "()Z", "", ApiSince=22)] get; [Android.Runtime.Register("setAsynchronous", "(Z)V", "", ApiSince=22)] set; }
[<get: Android.Runtime.Register("isAsynchronous", "()Z", "", ApiSince=22)>]
[<set: Android.Runtime.Register("setAsynchronous", "(Z)V", "", ApiSince=22)>]
member this.Asynchronous : bool with get, set

Property Value

True if the message is asynchronous.

Attributes

Remarks

Property getter documentation:

Returns true if the message is asynchronous, meaning that it is not subject to Looper synchronization barriers.

Java documentation for android.os.Message.isAsynchronous().

Property setter documentation:

Sets whether the message is asynchronous, meaning that it is not subject to Looper synchronization barriers.

Certain operations, such as view invalidation, may introduce synchronization barriers into the Looper's message queue to prevent subsequent messages from being delivered until some condition is met. In the case of view invalidation, messages which are posted after a call to android.view.View#invalidate are suspended by means of a synchronization barrier until the next frame is ready to be drawn. The synchronization barrier ensures that the invalidation request is completely handled before resuming.

Asynchronous messages are exempt from synchronization barriers. They typically represent interrupts, input events, and other signals that must be handled independently even while other work has been suspended.

Note that asynchronous messages may be delivered out of order with respect to synchronous messages although they are always delivered in order among themselves. If the relative order of these messages matters then they probably should not be asynchronous in the first place. Use with caution.

Java documentation for android.os.Message.setAsynchronous(boolean).

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