using System.Threading; namespace Tensorflow.Util { /// /// Provides a set of locks on different shared levels. /// public static class Locks { private static readonly ThreadLocal _lockpool = new ThreadLocal(() => new object()); /// /// A seperate lock for every requesting thread. /// /// This property is thread-safe. public static object ThreadWide => _lockpool.Value; public static readonly object ProcessWide = new object(); } }