コード例 #1
0
 void RaiseNewData(object context)
 {
     WinUSBDevice.NewDataCallback cb = NewDataEvent;
     if (cb != null)
     {
         long dataMarker = -1;
         while (dataMarker != TotalReceivedBytes)
         {
             dataMarker = TotalReceivedBytes;
             cb();
         }
     }
 }
コード例 #2
0
ファイル: WinUSBDevice.cs プロジェクト: nymda/SeekSharp
 void RaiseNewData(object context)
 {
     WinUSBDevice.NewDataCallback cb = NewDataEvent;
     if (cb != null)
     {
         if (EventConcurrency.WaitOne(0)) // Prevent requests from stacking up; Don't issue new events if there are several in flight
         {
             try
             {
                 cb();
             }
             finally
             {
                 EventConcurrency.Release();
             }
         }
     }
 }