Example #1
0
        public JvmThreadReference GetCurrentThread(JNIEnvHandle jniEnv)
        {
            jthread threadHandle;

            ThrowOnFailure(_rawInterface.GetCurrentThread(_env, out threadHandle));
            return(JvmThreadReference.FromHandle(this, jniEnv, threadHandle, true));
        }
Example #2
0
        public jvmtiError GetCurrentThread(JvmVirtualMachineRemoteHandle virtualMachine, out JvmThreadRemoteHandle threadHandle)
        {
            JavaVM machine = JavaVM.GetInstance(virtualMachine);

            jthread    thread = jthread.Null;
            jvmtiError result = jvmtiError.Internal;

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

            threadHandle = new JvmThreadRemoteHandle(thread);
            return(result);
        }