@@ -16,10 +16,10 @@ public class PythonEngine : IDisposable
16
16
private static extern uint GetCurrentThreadId ( ) ;
17
17
18
18
[ DllImport ( "libc" , EntryPoint = "pthread_self" ) ]
19
- private static extern UIntPtr pthread_selfLinux ( ) ;
19
+ private static extern ulong pthread_selfLinux ( ) ;
20
20
21
21
[ DllImport ( "pthread" , EntryPoint = "pthread_self" , CallingConvention = CallingConvention . Cdecl ) ]
22
- private static extern uint pthread_selfOSX ( ) ;
22
+ private static extern ulong pthread_selfOSX ( ) ;
23
23
24
24
public static ShutdownMode ShutdownMode
25
25
{
@@ -580,7 +580,7 @@ public static void Exec(string code, IntPtr? globals = null, IntPtr? locals = nu
580
580
/// Gets the native thread ID.
581
581
/// </summary>
582
582
/// <returns>The native thread ID.</returns>
583
- public static uint GetNativeThreadID ( )
583
+ public static ulong GetNativeThreadID ( )
584
584
{
585
585
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
586
586
{
@@ -589,7 +589,7 @@ public static uint GetNativeThreadID()
589
589
590
590
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
591
591
{
592
- return pthread_selfLinux ( ) . ToUInt32 ( ) ;
592
+ return pthread_selfLinux ( ) ;
593
593
}
594
594
595
595
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
@@ -605,24 +605,24 @@ public static uint GetNativeThreadID()
605
605
/// </summary>
606
606
/// <param name="nativeThreadID">The native thread ID.</param>
607
607
/// <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 )
609
609
{
610
610
if ( Runtime . PyVersion >= new Version ( 3 , 7 ) )
611
611
{
612
612
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
613
613
{
614
- return Runtime . PyThreadState_SetAsyncExc37Windows ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
614
+ return Runtime . PyThreadState_SetAsyncExc37Windows ( ( uint ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
615
615
}
616
616
617
- return Runtime . PyThreadState_SetAsyncExc37NonWindows ( new UIntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
617
+ return Runtime . PyThreadState_SetAsyncExc37NonWindows ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
618
618
}
619
619
620
620
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
621
621
{
622
622
return Runtime . PyThreadState_SetAsyncExc36Windows ( ( int ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
623
623
}
624
624
625
- return Runtime . PyThreadState_SetAsyncExc36NonWindows ( new IntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
625
+ return Runtime . PyThreadState_SetAsyncExc36NonWindows ( ( long ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
626
626
}
627
627
628
628
/// <summary>