public Git() : base(new ServiceModel("Git", "Distributed Version Control System", EnumExtensions.ToEnumerable<Privileges>())) { FileSystem = new FileSystem(Path.Combine(PathService, "repositories")); Directory.CreateDirectory(Path.Combine(PathService, "etc")); Authorization = new Authorization(Path.Combine(PathService, @"etc\")); }
public void AuthorizeRemoveUserThreadSafe() { var authorization = new Authorization(@"c:\temp\"); int[] threadCount = { 0 }; for (var i = 0; i < RepositoryCount; ++i) { int i1 = i; new TestDelegate(() => authorization.RemoveUser("Samir_" + i1, string.Format("repo_{0}", 0))).BeginInvoke( async => Interlocked.Increment(ref threadCount[0]), null); } while (threadCount[0] != RepositoryCount) { Thread.Sleep(500); } }