Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build-support/tools/nant/bin/NAnt.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
</strict>
</modes>
</runtime>
<reference-assemblies basedir="${environment::get-folder-path('ProgramFilesx86')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<reference-assemblies basedir="${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<include name="Accessibility.dll" />
<include name="Microsoft.Build.Conversion.v4.0.dll" />
<include name="Microsoft.Build.dll" />
Expand Down Expand Up @@ -683,7 +683,7 @@
<include name="System.Xml.Linq.dll" />
</reference-assemblies>
<!-- WPF Assemblies -->
<reference-assemblies basedir="${environment::get-folder-path('ProgramFilesx86')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<reference-assemblies basedir="${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<include name="NaturalLanguage6.dll" />
<include name="NlsData0009.dll" />
<include name="NlsLexicons0009.dll" />
Expand Down Expand Up @@ -711,7 +711,7 @@
<include name="wpfgfx_v0400.dll" />
<include name="wpftxt_v0400.dll" />
</reference-assemblies>
<reference-assemblies basedir="${environment::get-folder-path('ProgramFilesx86')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<reference-assemblies basedir="${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0">
<include name="Microsoft.Build.Conversion.v4.0.dll" />
<include name="Microsoft.Build.dll" />
<include name="Microsoft.Build.Engine.dll" />
Expand Down Expand Up @@ -1045,7 +1045,7 @@
<include name="wpfgfx_v0400.dll" />
<include name="wpftxt_v0400.dll" />
</reference-assemblies>
<reference-assemblies basedir="${environment::get-folder-path('ProgramFilesx86')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5">
<reference-assemblies basedir="${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5">
<include name="Microsoft.Build.Conversion.v4.0.dll" />
<include name="Microsoft.Build.dll" />
<include name="Microsoft.Build.Engine.dll" />
Expand Down
57 changes: 57 additions & 0 deletions src/Spring/Spring.Core/Threading/AsyncLocalStorage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections;
using System.Threading;

namespace Spring.Threading
{
/// <summary>
/// Implements <see cref="IThreadStorage"/> by using a <see cref="ThreadStaticAttribute"/> hashtable.
/// </summary>
/// <author>Erich Eichinger</author>

#if NETSTANDARD
public class AsyncLocalStorage : IThreadStorage
{

static AsyncLocal<Hashtable> data;

private static Hashtable Data
{
get
{
if (data == null) data = new AsyncLocal<Hashtable>();
return data.Value;
}
}

/// <summary>
/// Retrieves an object with the specified name.
/// </summary>
/// <param name="name">The name of the item.</param>
/// <returns>The object in the call context associated with the specified name or null if no object has been stored previously</returns>
public object GetData(string name)
{
return Data[name];
}

/// <summary>
/// Stores a given object and associates it with the specified name.
/// </summary>
/// <param name="name">The name with which to associate the new item.</param>
/// <param name="value">The object to store in the call context.</param>
public void SetData(string name, object value)
{
Data[name] = value;
}

/// <summary>
/// Empties a data slot with the specified name.
/// </summary>
/// <param name="name">The name of the data slot to empty.</param>
public void FreeNamedDataSlot(string name)
{
Data.Remove(name);
}
}
#endif
}
3 changes: 2 additions & 1 deletion src/Spring/Spring.Core/Threading/LogicalThreadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public sealed class LogicalThreadContext
/// </remarks>
private static IThreadStorage threadStorage =
#if NETSTANDARD
new ThreadStaticStorage();
//new ThreadStaticStorage();
new AsyncLocalStorage();
#else
new CallContextStorage();
#endif
Expand Down