MasterComponent.cs 642 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections.Generic;
  2. using System.Net;
  3. using System.Threading.Tasks;
  4. namespace ETModel
  5. {
  6. public class LockInfo
  7. {
  8. public IPEndPoint Address;
  9. public TaskCompletionSource<bool> Tcs;
  10. public LockInfo(IPEndPoint address, TaskCompletionSource<bool> tcs)
  11. {
  12. this.Address = address;
  13. this.Tcs = tcs;
  14. }
  15. }
  16. public class MasterComponent : Component
  17. {
  18. /// 镜像的地址
  19. public readonly List<IPEndPoint> ghostsAddress = new List<IPEndPoint>();
  20. /// 当前获取锁的进程地址
  21. public IPEndPoint lockedAddress;
  22. /// 请求锁的队列
  23. public readonly Queue<LockInfo> queue = new Queue<LockInfo>();
  24. }
  25. }