Esempio n. 1
0
        private static DeadlockDetector InitializeDeadlockDetector()
        {
            // Try to find a DeadlockDetector object from CallContext
            DeadlockDetector deadlockDetector = (DeadlockDetector)
                                                CallContext.LogicalGetData(c_DeadlockDetectorCallContextName);

            // If we find one, then use the one that was created in another AppDomain
            if (deadlockDetector != null)
            {
                return(deadlockDetector);
            }

            // We couldn't get one out of CallContext; let's create a new DeadlockDetector
            deadlockDetector = new DeadlockDetector();
            CallContext.LogicalSetData(c_DeadlockDetectorCallContextName, deadlockDetector);
            return(deadlockDetector);
        }
        private static DeadlockDetector InitializeDeadlockDetector() {
            // Try to find a DeadlockDetector object from CallContext
            DeadlockDetector deadlockDetector = (DeadlockDetector)
               CallContext.LogicalGetData(c_DeadlockDetectorCallContextName);

            // If we find one, then use the one that was created in another AppDomain
            if (deadlockDetector != null) return deadlockDetector;

            // We couldn't get one out of CallContext; let's create a new DeadlockDetector
            deadlockDetector = new DeadlockDetector();
            CallContext.LogicalSetData(c_DeadlockDetectorCallContextName, deadlockDetector);
            return deadlockDetector;
        }