We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e56164d commit e28d094Copy full SHA for e28d094
1 file changed
src/TensorFlowNET.Core/Util/Locks.cs
@@ -0,0 +1,21 @@
1
+using System.Threading;
2
+
3
+namespace Tensorflow.Util
4
+{
5
+ /// <summary>
6
+ /// Provides a set of locks on different shared levels.
7
+ /// </summary>
8
+ public static class Locks
9
+ {
10
+ private static readonly ThreadLocal<object> _lockpool = new ThreadLocal<object>(() => new object());
11
12
13
+ /// A seperate lock for every requesting thread.
14
15
+ /// <remarks>This property is thread-safe.</remarks>
16
+ public static object ThreadWide => _lockpool.Value;
17
18
19
+ public static readonly object ProcessWide = new object();
20
+ }
21
+}
0 commit comments