SynchronousQueue.Offer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Offer(Object) |
Inserts the specified element into this queue, if another thread is waiting to receive it. |
Offer(Object, Int64, TimeUnit) |
Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it. |
Offer(Object)
Inserts the specified element into this queue, if another thread is waiting to receive it.
[Android.Runtime.Register("offer", "(Ljava/lang/Object;)Z", "GetOffer_Ljava_lang_Object_Handler")]
public override bool Offer (Java.Lang.Object? e);
[<Android.Runtime.Register("offer", "(Ljava/lang/Object;)Z", "GetOffer_Ljava_lang_Object_Handler")>]
override this.Offer : Java.Lang.Object -> bool
Parameters
- e
- Object
the element to add
Returns
true
if the element was added to this queue, else
false
Implements
- Attributes
Remarks
Inserts the specified element into this queue, if another thread is waiting to receive it.
Java documentation for java.util.concurrent.SynchronousQueue.offer(E)
.
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
Offer(Object, Int64, TimeUnit)
Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it.
[Android.Runtime.Register("offer", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOffer_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler")]
public virtual bool Offer (Java.Lang.Object? e, long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("offer", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOffer_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler")>]
override this.Offer : Java.Lang.Object * int64 * Java.Util.Concurrent.TimeUnit -> bool
Parameters
- e
- Object
the element to add
- timeout
- Int64
- unit
- TimeUnit
Returns
true
if successful, or false
if the
specified waiting time elapses before a consumer appears
Implements
- Attributes
Remarks
Inserts the specified element into this queue, waiting if necessary up to the specified wait time for another thread to receive it.
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.