ForkJoinTask.CompareAndSetForkJoinTaskTag(Int16, Int16) 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.
Atomically conditionally sets the tag value for this task.
[Android.Runtime.Register("compareAndSetForkJoinTaskTag", "(SS)Z", "", ApiSince=24)]
public bool CompareAndSetForkJoinTaskTag (short expect, short update);
[<Android.Runtime.Register("compareAndSetForkJoinTaskTag", "(SS)Z", "", ApiSince=24)>]
member this.CompareAndSetForkJoinTaskTag : int16 * int16 -> bool
Parameters
- expect
- Int16
the expected tag value
- update
- Int16
the new tag value
Returns
true
if successful; i.e., the current value was
equal to expect
and was changed to update
.
- Attributes
Remarks
Atomically conditionally sets the tag value for this task. Among other applications, tags can be used as visit markers in tasks operating on graphs, as in methods that check: if (task.compareAndSetForkJoinTaskTag((short)0, (short)1))
before processing, otherwise exiting because the node has already been visited.
Added in 1.8.
Java documentation for java.util.concurrent.ForkJoinTask.compareAndSetForkJoinTaskTag(short, short)
.
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.