C# 进程间的同步 EventWaitHandle

  private const string Event_GUID = "{7D63AEC9-771C-4701-9A6E-FFAA88EC01EF}";

 

进程A.

 public static EventWaitHandle SystemSyncEvent { get; set; }

 SystemSyncEvent = EventWaitHandle.OpenExisting(Event_GUID);

 ewh.Set();

 

进程B.

 private const string Event_GUID = "{7D63AEC9-771C-4701-9A6E-FFAA88EC01EF}";

 public static EventWaitHandle SystemSyncEvent { get; set; }

 SystemSyncEvent = EventWaitHandle.OpenExisting(Event_GUID);

 SystemSyncEvent.WaitOne();//等待plc托管wcf服务启动完成

 

上一篇:c++ template函数的声明和实现需要在同一个文件中


下一篇:【转】一个非常常见但容易被忽略的c++问题——用IPML模式可以解决