IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
AccessorUtil.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Threading;
3
4
namespace
IKVM.Runtime.Accessors
5
{
6
7
static
class
AccessorUtil
8
{
9
16
public
static
T
LazyGet<T>
(
ref
T location, Func<T> create)
17
where T :
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
}
27
28
}
29
30
}
Interlocked
System.Threading.Interlocked Interlocked
Definition
ExceptionHelper.cs:34
IKVM.Runtime.Accessors.AccessorUtil
Definition
AccessorUtil.cs:8
IKVM.Runtime.Accessors.AccessorUtil.LazyGet< T >
static T LazyGet< T >(ref T location, Func< T > create)
Gets the value at the given location or initializes it if null.
Definition
AccessorUtil.cs:16
IKVM.Runtime.Accessors
Definition
Accessor.cs:5
System
Definition
HexConverter.cs:9
ref
Definition
Reference.cs:28
src
IKVM.Runtime
Accessors
AccessorUtil.cs
Generated by
1.12.0