public WaitData GetThreadWaitChain(int threadId)
        {
            WaitChainNativeMethods.WAITCHAIN_NODE_INFO[] data = new WaitChainNativeMethods.WAITCHAIN_NODE_INFO[WaitChainNativeMethods.WCT_MAX_NODE_COUNT];
            int isDeadlock;
            int nodeCount = WaitChainNativeMethods.WCT_MAX_NODE_COUNT;

            WaitData retData = null;

            if (WaitChainNativeMethods.GetThreadWaitChain(waitChainHandle, threadId, ref nodeCount, data, out isDeadlock))
            {
                retData = new WaitData(data, nodeCount, isDeadlock == 1);
            }

            return(retData);
        }
Esempio n. 2
0
 public WaitData(WaitChainNativeMethods.WAITCHAIN_NODE_INFO[] data, int nodeCount, bool isDeadlock)
 {
     this.data = data;
     this.nodeCount = nodeCount;
     this.isDeadlock = isDeadlock;
 }
 protected override bool ReleaseHandle()
 {
     WaitChainNativeMethods.CloseThreadWaitChainSession(this.handle);
     return(true);
 }
 public WaitChainTraversal()
 {
     waitChainHandle = WaitChainNativeMethods.OpenThreadWaitChainSession();
 }
 protected override Boolean ReleaseHandle()
 {
     return(WaitChainNativeMethods.FreeLibrary(this.handle));
 }