@@ -16,10 +16,10 @@ public class PythonEngine : IDisposable
1616 private static extern uint GetCurrentThreadId ( ) ;
1717
1818 [ DllImport ( "libc" , EntryPoint = "pthread_self" ) ]
19- private static extern UIntPtr pthread_selfLinux ( ) ;
19+ private static extern ulong pthread_selfLinux ( ) ;
2020
2121 [ DllImport ( "pthread" , EntryPoint = "pthread_self" , CallingConvention = CallingConvention . Cdecl ) ]
22- private static extern uint pthread_selfOSX ( ) ;
22+ private static extern ulong pthread_selfOSX ( ) ;
2323
2424 public static ShutdownMode ShutdownMode
2525 {
@@ -580,7 +580,7 @@ public static void Exec(string code, IntPtr? globals = null, IntPtr? locals = nu
580580 /// Gets the native thread ID.
581581 /// </summary>
582582 /// <returns>The native thread ID.</returns>
583- public static uint GetNativeThreadID ( )
583+ public static ulong GetNativeThreadID ( )
584584 {
585585 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
586586 {
@@ -589,7 +589,7 @@ public static uint GetNativeThreadID()
589589
590590 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
591591 {
592- return pthread_selfLinux ( ) . ToUInt32 ( ) ;
592+ return pthread_selfLinux ( ) ;
593593 }
594594
595595 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
@@ -605,24 +605,24 @@ public static uint GetNativeThreadID()
605605 /// </summary>
606606 /// <param name="nativeThreadID">The native thread ID.</param>
607607 /// <returns>The number of thread states modified; this is normally one, but will be zero if the thread id isn’t found.</returns>
608- public static int Interrupt ( uint nativeThreadID )
608+ public static int Interrupt ( ulong nativeThreadID )
609609 {
610610 if ( Runtime . PyVersion >= new Version ( 3 , 7 ) )
611611 {
612612 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
613613 {
614- return Runtime . PyThreadState_SetAsyncExc37Windows ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
614+ return Runtime . PyThreadState_SetAsyncExc37Windows ( ( uint ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
615615 }
616616
617- return Runtime . PyThreadState_SetAsyncExc37NonWindows ( new UIntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
617+ return Runtime . PyThreadState_SetAsyncExc37NonWindows ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
618618 }
619619
620620 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
621621 {
622622 return Runtime . PyThreadState_SetAsyncExc36Windows ( ( int ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
623623 }
624624
625- return Runtime . PyThreadState_SetAsyncExc36NonWindows ( new IntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
625+ return Runtime . PyThreadState_SetAsyncExc36NonWindows ( ( long ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
626626 }
627627
628628 /// <summary>
0 commit comments