Beispiel #1
0
		internal static IDisposable AssertNoPendingShutdown()
		{
			if (CimApplication.IsShutdownPendingLock.WaitingWriteCount == 0)
			{
				IDisposable readerWriterLockSlimReaderLock = new CimApplication.ReaderWriterLockSlim_ReaderLock(CimApplication.IsShutdownPendingLock);
				if (!CimApplication._isShutdownPending)
				{
					return readerWriterLockSlimReaderLock;
				}
				else
				{
					readerWriterLockSlimReaderLock.Dispose();
					throw new InvalidOperationException(Strings.AppDomainIsBeingUnloaded);
				}
			}
			else
			{
				throw new InvalidOperationException(Strings.AppDomainIsBeingUnloaded);
			}
		}
Beispiel #2
0
 internal static IDisposable AssertNoPendingShutdown()
 {
     if (CimApplication.IsShutdownPendingLock.WaitingWriteCount == 0)
     {
         IDisposable readerWriterLockSlimReaderLock = new CimApplication.ReaderWriterLockSlim_ReaderLock(CimApplication.IsShutdownPendingLock);
         if (!CimApplication._isShutdownPending)
         {
             return(readerWriterLockSlimReaderLock);
         }
         else
         {
             readerWriterLockSlimReaderLock.Dispose();
             throw new InvalidOperationException(Strings.AppDomainIsBeingUnloaded);
         }
     }
     else
     {
         throw new InvalidOperationException(Strings.AppDomainIsBeingUnloaded);
     }
 }