@@ -568,28 +568,28 @@ public static void Exec(string code, IntPtr? globals = null, IntPtr? locals = nu
568568 }
569569
570570 /// <summary>
571- /// Gets the native thread ID.
571+ /// Gets the Python thread ID.
572572 /// </summary>
573- /// <returns>The native thread ID.</returns>
574- public static ulong GetNativeThreadID ( )
573+ /// <returns>The Python thread ID.</returns>
574+ public static ulong GetPythonThreadID ( )
575575 {
576- dynamic threading = Py . Import ( "threading" ) ;
577- return threading . get_ident ( ) ;
576+ var threading = Py . Import ( "threading" ) ;
577+ return threading . InvokeMethod ( "get_ident" ) ;
578578 }
579579
580580 /// <summary>
581581 /// Interrupts the execution of a thread.
582582 /// </summary>
583- /// <param name="nativeThreadID ">The native thread ID.</param>
583+ /// <param name="pythonThreadID ">The Python thread ID.</param>
584584 /// <returns>The number of thread states modified; this is normally one, but will be zero if the thread id isn’t found.</returns>
585- public static int Interrupt ( ulong nativeThreadID )
585+ public static int Interrupt ( ulong pythonThreadID )
586586 {
587587 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
588588 {
589- return Runtime . PyThreadState_SetAsyncExcLLP64 ( ( uint ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
589+ return Runtime . PyThreadState_SetAsyncExcLLP64 ( ( uint ) pythonThreadID , Exceptions . KeyboardInterrupt ) ;
590590 }
591591
592- return Runtime . PyThreadState_SetAsyncExcLP64 ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
592+ return Runtime . PyThreadState_SetAsyncExcLP64 ( pythonThreadID , Exceptions . KeyboardInterrupt ) ;
593593 }
594594
595595 /// <summary>
0 commit comments