Esempio n. 1
0
        public jvmtiError GetThreadInfo(JvmVirtualMachineRemoteHandle virtualMachine, JvmThreadRemoteHandle thread, out JvmThreadRemoteInfo info)
        {
            JavaVM machine = JavaVM.GetInstance(virtualMachine);

            jvmtiThreadInfo threadInfo = default(jvmtiThreadInfo);
            jvmtiError      result     = jvmtiError.Internal;

            machine.InvokeOnJvmThread(
                (environment) =>
            {
                jvmtiInterface rawInterface = environment.RawInterface;
                result = rawInterface.GetThreadInfo(environment.Handle, thread, out threadInfo);
            });

            info = new JvmThreadRemoteInfo()
            {
                Name               = threadInfo.Name,
                Priority           = threadInfo._priority,
                IsDaemon           = threadInfo._isDaemon != 0,
                ContextClassLoader = new JvmObjectRemoteHandle(threadInfo._contextClassLoader),
                ThreadGroup        = new JvmThreadGroupRemoteHandle(threadInfo._threadGroup)
            };

            return(result);
        }
Esempio n. 2
0
 internal JvmThreadInfo(JvmEnvironment environment, JNIEnvHandle jniEnv, jvmtiThreadInfo threadInfo, bool freeLocalReference)
 {
     this.Name               = threadInfo.Name;
     this.Priority           = threadInfo._priority;
     this.IsDaemon           = threadInfo._isDaemon != 0;
     this.ThreadGroup        = JvmThreadGroupReference.FromHandle(environment, jniEnv, threadInfo._threadGroup, freeLocalReference);
     this.ContextClassLoader = JvmObjectReference.FromHandle(environment, jniEnv, threadInfo._contextClassLoader, freeLocalReference);
 }