Skip to content

Commit

Permalink
restoring to ThreadLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
skclusive committed Dec 4, 2019
1 parent b645786 commit d6bfe35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/Observable/Concretes/States.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ namespace Skclusive.Mobx.Observable
{
internal class States
{
private static AsyncLocal<State> _LocalState = new AsyncLocal<State>();
// private static AsyncLocal<State> _LocalState = new AsyncLocal<State>();

internal static State State { get => (_LocalState.Value ?? (_LocalState.Value = new State())); }
// internal static State State { get => (_LocalState.Value ?? (_LocalState.Value = new State())); }

private static ThreadLocal<State> _LocalState = new ThreadLocal<State>(() => new State());

internal static State State { get => _LocalState.Value; }

private static int MAX_REACTION_ITERATIONS = 100;

Expand Down
2 changes: 1 addition & 1 deletion src/Observable/Observable.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>1.0.3</VersionPrefix>
<VersionPrefix>1.0.4</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>Skclusive.Mobx.Observable</AssemblyName>
Expand Down

0 comments on commit d6bfe35

Please sign in to comment.