IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Runtime.Accessors.AccessorUtil Class Reference

Static Public Member Functions

static T LazyGet< T > (ref T location, Func< T > create)
 Gets the value at the given location or initializes it if null.
 

Detailed Description

Definition at line 7 of file AccessorUtil.cs.

Member Function Documentation

◆ LazyGet< T >()

static T IKVM.Runtime.Accessors.AccessorUtil.LazyGet< T > ( ref T location,
Func< T > create )
static

Gets the value at the given location or initializes it if null.

Parameters
location
create
Returns
Type Constraints
T :class 

Definition at line 16 of file AccessorUtil.cs.

17 : class
18 {
19 if (create is null)
20 throw new ArgumentNullException(nameof(create));
21
22 if (location == null)
23 Interlocked.CompareExchange(ref location, create(), null);
24
25 return location;
26 }
System.Threading.Interlocked Interlocked

The documentation for this class was generated from the following file: