コード例 #1
0
ファイル: EventSource.cs プロジェクト: modulexcite/pash-1
 private void UnRegister()
 {
     lock (this)
     {
         if (this.registrar != null)
         {
             if (this.workerThreadInitialized)
             {
                 this.alive = false;
                 this.doIndicate.Set();
                 GC.KeepAlive(this);
                 this.workerThreadInitialized = false;
             }
             this.registrar.UnRegister_();
             this.registrar = null;
         }
     }
 }
コード例 #2
0
        void UnRegister()
        {
            lock (this)
            {
                // Only unregister one time
                if (registrar == null)
                {
                    return;
                }

                // Kill worker thread
                if (lengthFromSTA != -1)
                {
                    alive = false;
                    SetEvent(hDoIndicate);
                    //                doIndicate.Set();
                }
                registrar.UnRegister_();
                registrar = null;
            }
        }
コード例 #3
0
ファイル: EventSource.cs プロジェクト: nickchal/pash
		public EventSource(string namespaceName, string appName, InstrumentedAssembly instrumentedAssembly)
		{
			this.registrar = (IWbemDecoupledRegistrar)(new WbemDecoupledRegistrar());
			this.reqList = new ArrayList(3);
			this.critSec = new object();
			this.doIndicate = new AutoResetEvent(false);
			this.alive = true;
			this.mapQueryIdToQuery = new Hashtable();
			lock (EventSource.eventSources)
			{
				if (EventSource.shutdownInProgress == 0)
				{
					this.instrumentedAssembly = instrumentedAssembly;
					int num = this.registrar.Register_(0, null, null, null, namespaceName, appName, this);
					if (num != 0)
					{
						Marshal.ThrowExceptionForHR(num);
					}
					EventSource.eventSources.Add(this);
				}
			}
		}
コード例 #4
0
ファイル: EventSource.cs プロジェクト: wenzai007/dotnet462
        void UnRegister()
        {
            lock (this)
            {
                // Only unregister one time
                if (registrar == null)
                {
                    return;
                }

                // Kill worker thread
                if (workerThreadInitialized == true)
                {
                    alive = false;
                    doIndicate.Set(); // SetEvent(hDoIndicate);
                    GC.KeepAlive(this);
                    workerThreadInitialized = false;
                }
                registrar.UnRegister_();
                registrar = null;
            }
        }
コード例 #5
0
ファイル: EventSource.cs プロジェクト: modulexcite/pash-1
 public EventSource(string namespaceName, string appName, InstrumentedAssembly instrumentedAssembly)
 {
     this.registrar         = (IWbemDecoupledRegistrar)(new WbemDecoupledRegistrar());
     this.reqList           = new ArrayList(3);
     this.critSec           = new object();
     this.doIndicate        = new AutoResetEvent(false);
     this.alive             = true;
     this.mapQueryIdToQuery = new Hashtable();
     lock (EventSource.eventSources)
     {
         if (EventSource.shutdownInProgress == 0)
         {
             this.instrumentedAssembly = instrumentedAssembly;
             int num = this.registrar.Register_(0, null, null, null, namespaceName, appName, this);
             if (num != 0)
             {
                 Marshal.ThrowExceptionForHR(num);
             }
             EventSource.eventSources.Add(this);
         }
     }
 }
コード例 #6
0
ファイル: EventSource.cs プロジェクト: nickchal/pash
		private void UnRegister()
		{
			lock (this)
			{
				if (this.registrar != null)
				{
					if (this.workerThreadInitialized)
					{
						this.alive = false;
						this.doIndicate.Set();
						GC.KeepAlive(this);
						this.workerThreadInitialized = false;
					}
					this.registrar.UnRegister_();
					this.registrar = null;
				}
			}
		}
コード例 #7
0
        void UnRegister()
        {
            lock(this)
            {
                // Only unregister one time
                if(registrar == null)
                    return;

                // Kill worker thread
                if(workerThreadInitialized == true)
                {
                    alive = false;
                    doIndicate.Set(); // SetEvent(hDoIndicate);
                    GC.KeepAlive(this);
                    workerThreadInitialized = false;
                }
                registrar.UnRegister_();
                registrar = null;
            }
        }