You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/core/Akka/Util/FastLazy.cs
+28-117
Original file line number
Diff line number
Diff line change
@@ -15,144 +15,55 @@ namespace Akka.Util
15
15
/// A fast, atomic lazy that only allows a single publish operation to happen,
16
16
/// but allows executions to occur concurrently.
17
17
///
18
-
/// Does not cache exceptions. Designed for use with <typeparamref name="T"/> types that are <see cref="IDisposable"/>
19
-
/// or are otherwise considered to be expensive to allocate.
20
-
///
21
-
/// Read the full explanation here: https://github.com/Aaronontheweb/FastAtomicLazy#rationale
18
+
/// Does not cache exceptions. Designed for use with <typeparam name="T"/> types that are <see cref="IDisposable"/>
19
+
/// or are otherwise considered to be expensive to allocate. Read the full explanation here: https://github.com/Aaronontheweb/FastAtomicLazy#rationale
22
20
/// </summary>
23
-
/// <typeparam name="T">TBD</typeparam>
24
21
publicsealedclassFastLazy<T>
25
22
{
26
-
privatereadonlyFunc<T>_producer;
27
-
privatebyte_created=0;
28
-
privatebyte_creating=0;
23
+
privateFunc<T>_producer;
24
+
privateint_status=0;
25
+
privateException_exception;
29
26
privateT_createdValue;
30
27
31
-
/// <summary>
32
-
/// Initializes a new instance of the <see cref="FastLazy{T}"/> class.
33
-
/// </summary>
34
-
/// <exception cref="ArgumentNullException">
35
-
/// This exception is thrown if the given <paramref name="producer"/> is undefined.
36
-
/// </exception>
37
28
publicFastLazy(Func<T>producer)
38
29
{
39
-
if(producer==null)thrownewArgumentNullException(nameof(producer),"Producer cannot be null");
0 commit comments