Beispiel #1
0
 /// <summary>
 /// Shuts down the GRPC environment if it was initialized before.
 /// Repeated invocations have no effect.
 /// </summary>
 public static void Shutdown()
 {
     lock (staticLock)
     {
         if (instance != null)
         {
             instance.Close();
             instance = null;
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Decrements the reference count for currently active environment and shuts down the gRPC environment if reference count drops to zero.
 /// (and blocks until the environment has been fully shutdown).
 /// </summary>
 internal static void Release()
 {
     lock (staticLock)
     {
         Preconditions.CheckState(refCount > 0);
         refCount--;
         if (refCount == 0)
         {
             instance.Close();
             instance = null;
         }
     }
 }