예제 #1
0
 stateChanged(Ice.Instrumentation.ThreadState o, Ice.Instrumentation.ThreadState n)
 {
     lock (this)
     {
         ++states;
     }
 }
예제 #2
0
파일: ThreadPool.cs 프로젝트: zmyer/ice
 internal WorkerThread(ThreadPool threadPool, string name) : base()
 {
     _threadPool = threadPool;
     _name       = name;
     _state      = Ice.Instrumentation.ThreadState.ThreadStateIdle;
     updateObserver();
 }
예제 #3
0
 getThreadObserver(string p,
                   string n,
                   Ice.Instrumentation.ThreadState s,
                   Ice.Instrumentation.ThreadObserver o)
 {
     return(null);
 }
예제 #4
0
 public ThreadHelper(string parent, string id, Ice.Instrumentation.ThreadState state)
     : base(_attributes)
 {
     Parent = parent;
     Id     = id;
     _state = state;
 }
예제 #5
0
 public void stateChanged(Ice.Instrumentation.ThreadState oldState, Ice.Instrumentation.ThreadState newState)
 {
     _oldState = oldState;
     _newState = newState;
     forEach(threadStateUpdate);
     if (delegate_ != null)
     {
         delegate_.stateChanged(oldState, newState);
     }
 }
예제 #6
0
 public void StateChanged(Ice.Instrumentation.ThreadState oldState, Ice.Instrumentation.ThreadState newState)
 {
     _oldState = oldState;
     _newState = newState;
     ForEach(ThreadStateUpdate);
     if (Delegate != null)
     {
         Delegate.StateChanged(oldState, newState);
     }
 }
예제 #7
0
파일: ThreadPool.cs 프로젝트: zmyer/ice
 public void setState(Ice.Instrumentation.ThreadState s)
 {
     // Must be called with the thread pool mutex locked
     if (_observer != null)
     {
         if (_state != s)
         {
             _observer.stateChanged(_state, s);
         }
     }
     _state = s;
 }
예제 #8
0
 GetThreadObserver(string p, string id, Ice.Instrumentation.ThreadState s, Ice.Instrumentation.IThreadObserver? old)
 {
     lock (this)
     {
         TestHelper.Assert(old == null || old is ThreadObserver);
         if (threadObserver == null)
         {
             threadObserver = new ThreadObserver();
             threadObserver.reset();
         }
         return(threadObserver);
     }
 }
예제 #9
0
 getThreadObserver(String p, String id, Ice.Instrumentation.ThreadState s,
                   Ice.Instrumentation.ThreadObserver old)
 {
     lock (this)
     {
         Debug.Assert(old == null || old is ThreadObserverI);
         if (threadObserver == null)
         {
             threadObserver = new ThreadObserverI();
             threadObserver.reset();
         }
         return(threadObserver);
     }
 }
예제 #10
0
 public Ice.Instrumentation.ThreadObserver getThreadObserver(string parent, string id,
                                                             Ice.Instrumentation.ThreadState s,
                                                             Ice.Instrumentation.ThreadObserver obsv)
 {
     if (_threads.isEnabled())
     {
         try
         {
             Ice.Instrumentation.ThreadObserver del = null;
             ThreadObserverI o = obsv is ThreadObserverI ? (ThreadObserverI)obsv : null;
             if (_delegate != null)
             {
                 del = _delegate.getThreadObserver(parent, id, s, o != null ? o.getDelegate() : obsv);
             }
             return(_threads.getObserver(new ThreadHelper(parent, id, s), obsv, del));
         }
         catch (Exception ex)
         {
             _metrics.getLogger().error("unexpected exception trying to obtain observer:\n" + ex);
         }
     }
     return(null);
 }
예제 #11
0
 public Ice.Instrumentation.IThreadObserver? GetThreadObserver(string parent, string id,
                                                               Ice.Instrumentation.ThreadState s,
                                                               Ice.Instrumentation.IThreadObserver? oldObsv)
 {
     if (_threads.IsEnabled())
     {
         try
         {
             Ice.Instrumentation.IThreadObserver?newDelegate = null;
             if (_delegate != null)
             {
                 ThreadObserverI?o = oldObsv is ThreadObserverI ? (ThreadObserverI)oldObsv : null;
                 newDelegate = _delegate.GetThreadObserver(parent, id, s, o != null ? o.GetDelegate() : oldObsv);
             }
             return(_threads.GetObserver(new ThreadHelper(parent, id, s), oldObsv, newDelegate));
         }
         catch (System.Exception ex)
         {
             _metrics.GetLogger().Error("unexpected exception trying to obtain observer:\n" + ex);
         }
     }
     return(null);
 }
예제 #12
0
 public void setState(Ice.Instrumentation.ThreadState s)
 {
     // Must be called with the thread pool mutex locked
     if(_observer != null)
     {
         if(_state != s)
         {
             _observer.stateChanged(_state, s);
         }
     }
     _state = s;
 }
예제 #13
0
 internal WorkerThread(ThreadPool threadPool, string name)
     : base()
 {
     _threadPool = threadPool;
     _name = name;
     _state = Ice.Instrumentation.ThreadState.ThreadStateIdle;
     updateObserver();
 }
예제 #14
0
 public Ice.Instrumentation.IThreadObserver?GetThreadObserver(
     string p, string n, Ice.Instrumentation.ThreadState s, Ice.Instrumentation.IThreadObserver? o) => null;