Skip to content

Commit a6c1571

Browse files
committed
Turn off thread affinity by default
Closes #225
1 parent 07b9963 commit a6c1571

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

LibGit2Sharp/Core/Proxy.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,19 @@ private static string ConvertPath(Func<byte[], uint, int> pathRetriever)
17681768
}
17691769
}
17701770

1771-
private static IDisposable ThreadAffinity()
1771+
private static Func<IDisposable> ThreadAffinity = WithoutThreadAffinity;
1772+
1773+
internal static void EnableThreadAffinity()
1774+
{
1775+
ThreadAffinity = WithThreadAffinity;
1776+
}
1777+
1778+
private static IDisposable WithoutThreadAffinity()
1779+
{
1780+
return null;
1781+
}
1782+
1783+
private static IDisposable WithThreadAffinity()
17721784
{
17731785
return new DisposableThreadAffinityWrapper();
17741786
}

0 commit comments

Comments
 (0)