Example #1
0
 public static WaitHandle[] GetHandles(SyncObject[] objs)
 {
     WaitHandle[] waitHandles = new WaitHandle[objs.Length];
     for (int i = 0; i < objs.Length; i++)
     {
         waitHandles[i] = objs[i].Handle;
     }
     return waitHandles;
 }
Example #2
0
 /// <summary>
 /// ���Ӷ���
 /// </summary>
 /// <param name="obj"></param>
 public static void AddObject(SyncObject obj)
 {
     SyncObject tempObj = GetObject(obj.Name);
     if (tempObj != null)
     {
         if (tempObj == obj)
         {
             throw new FireSpiderException("�������һ��ͬ�������μ��뵽�߳̿�������");
         }
         throw new FireSpiderException("�Ѿ�����һ������Ϊ\"" + obj.Name + "\"��ͬ������");
     }
     objectList.Add(obj.Name, obj);
     if (ObjectAdded != null)
     {
         ObjectAdded(obj);
     }
 }
Example #3
0
 public static int WaitAny(SyncObject[] objs, int dwMilliseconds, bool exitContext)
 {
     WaitHandle[] waitHandles = GetHandles(objs);
     return WaitHandle.WaitAny(waitHandles, dwMilliseconds, exitContext);
 }