Esempio n. 1
0
 public void Release()
 {
     //TODO invalidate view information
     Logger.LogTrace("Release()");
     if (Running)
     {
         Logger.LogTrace("Release() locking");
         SemaphoreSlim.Wait(CancelSource.Token);
         Logger.LogTrace("Release() locked");
         Running = false;
         CancelSource.Cancel();
         IncomingMessagesTask?.Wait();
         OutgoingMessagesTask?.Wait();
         Instance = null;
         Logger.LogTrace("Release() releasing global");
         LibUtils.Unlock();
         Logger.LogTrace("Release() releasing local");
         SemaphoreSlim.Release();
         Logger.LogTrace("Release() released");
     }
     else
     {
         Logger.LogWarning("SignalLibHandle was already closed");
     }
 }
Esempio n. 2
0
 public void Release()
 {
     //TODO invalidate view information
     Logger.LogTrace("Release() locking");
     SemaphoreSlim.Wait(CancelSource.Token);
     Running = false;
     CancelSource.Cancel();
     IncomingMessagesTask?.Wait();
     OutgoingMessagesTask?.Wait();
     Instance = null;
     Logger.LogTrace("Release() releasing global)");
     LibUtils.Unlock();
     Logger.LogTrace("Release() releasing local)");
     SemaphoreSlim.Release();
     Logger.LogTrace("Release() released");
 }