コード例 #1
0
        internal ThreadGroupReference GetMirrorOf(ThreadGroupId threadGroup)
        {
            if (threadGroup == default(ThreadGroupId))
            {
                return(null);
            }

            return(new ThreadGroupReference(this, threadGroup));
        }
コード例 #2
0
 internal ThreadGroupReference(VirtualMachine virtualMachine, ThreadGroupId threadGroupId)
     : base(virtualMachine, threadGroupId, null)
 {
     Contract.Requires(virtualMachine != null);
 }
コード例 #3
0
 internal ThreadGroupReference(VirtualMachine virtualMachine, ThreadGroupId threadGroupId)
     : base(virtualMachine, threadGroupId, null)
 {
     Contract.Requires(virtualMachine != null);
 }
コード例 #4
0
 public Error GetThreadGroupChildren(out ThreadId[] childThreads, out ThreadGroupId[] childGroups, ThreadGroupId group)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public Error GetTopLevelThreadGroups(out ThreadGroupId[] groups)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public Error GetThreadGroupName(out string groupName, ThreadGroupId group)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public Error GetThreadGroupParent(out ThreadGroupId parentGroup, ThreadGroupId group)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public Error GetThreadGroup(out ThreadGroupId threadGroup, ThreadId thread)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
        public Error GetTopLevelThreadGroups(out ThreadGroupId[] groups)
        {
            groups = null;

            JniEnvironment nativeEnvironment;
            JvmtiEnvironment environment;
            jvmtiError error = GetEnvironment(out environment, out nativeEnvironment);
            if (error != jvmtiError.None)
                return GetStandardError(error);

            error = environment.GetTopThreadGroups(nativeEnvironment, out groups);
            return GetStandardError(error);
        }
コード例 #10
0
        public Error GetThreadGroup(ThreadId threadId, out ThreadGroupId threadGroup)
        {
            threadGroup = default(ThreadGroupId);

            JniEnvironment nativeEnvironment;
            JvmtiEnvironment environment;
            jvmtiError error = GetEnvironment(out environment, out nativeEnvironment);
            if (error != jvmtiError.None)
                return GetStandardError(error);

            using (var thread = VirtualMachine.GetLocalReferenceForThread(nativeEnvironment, threadId))
            {
                if (!thread.IsAlive)
                    return Error.InvalidThread;

                jvmtiThreadInfo threadInfo;
                error = environment.GetThreadInfo(thread.Value, out threadInfo);
                if (error != jvmtiError.None)
                    return GetStandardError(error);

                threadGroup = (ThreadGroupId)VirtualMachine.TrackLocalObjectReference(threadInfo._threadGroup, environment, nativeEnvironment, true);
                nativeEnvironment.DeleteLocalReference(threadInfo._contextClassLoader);
                environment.Deallocate(threadInfo._name);
                return Error.None;
            }
        }
コード例 #11
0
ファイル: VirtualMachine.cs プロジェクト: Kav2018/JavaForVS
        internal ThreadGroupReference GetMirrorOf(ThreadGroupId threadGroup)
        {
            if (threadGroup == default(ThreadGroupId))
                return null;

            return new ThreadGroupReference(this, threadGroup);
        }
コード例 #12
0
ファイル: JvmtiEnvironment.cs プロジェクト: Kav2018/JavaForVS
        public jvmtiError GetTopThreadGroups(JniEnvironment nativeEnvironment, out ThreadGroupId[] threadGroups)
        {
            threadGroups = null;

            int threadsGroupsCount;
            IntPtr threadsGroupsPtr;
            jvmtiError error = RawInterface.GetTopThreadGroups(this, out threadsGroupsCount, out threadsGroupsPtr);
            if (error != jvmtiError.None)
                return error;

            try
            {
                List<ThreadGroupId> threadGroupList = new List<ThreadGroupId>();
                unsafe
                {
                    jthreadGroup* threadGroupHandles = (jthreadGroup*)threadsGroupsPtr;
                    for (int i = 0; i < threadsGroupsCount; i++)
                    {
                        if (threadGroupHandles[i] == jthreadGroup.Null)
                            continue;

                        threadGroupList.Add((ThreadGroupId)VirtualMachine.TrackLocalObjectReference(threadGroupHandles[i], this, nativeEnvironment, true));
                    }
                }

                threadGroups = threadGroupList.ToArray();
                return jvmtiError.None;
            }
            finally
            {
                Deallocate(threadsGroupsPtr);
            }
        }