@@ -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 IntPtr pthread_selfLinux ( ) ;
19
+ private static extern UIntPtr pthread_selfLinux ( ) ;
20
20
21
21
[ DllImport ( "pthread" , EntryPoint = "pthread_self" , CallingConvention = CallingConvention . Cdecl ) ]
22
- private static extern ulong pthread_selfOSX ( ) ;
22
+ private static extern uint 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 ulong GetNativeThreadID ( )
583
+ public static uint GetNativeThreadID ( )
584
584
{
585
585
if ( Runtime . PyVersion >= new Version ( 3 , 8 ) )
586
586
{
@@ -595,7 +595,7 @@ public static ulong GetNativeThreadID()
595
595
596
596
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
597
597
{
598
- return ( ulong ) pthread_selfLinux ( ) ;
598
+ return pthread_selfLinux ( ) . ToUInt32 ( ) ;
599
599
}
600
600
601
601
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
@@ -611,7 +611,7 @@ public static ulong GetNativeThreadID()
611
611
/// </summary>
612
612
/// <param name="nativeThreadID">The native thread ID.</param>
613
613
/// <returns>The number of thread states modified; this is normally one, but will be zero if the thread id isn’t found.</returns>
614
- public static int Interrupt ( ulong nativeThreadID )
614
+ public static int Interrupt ( uint nativeThreadID )
615
615
{
616
616
if ( Runtime . PyVersion >= new Version ( 3 , 7 ) )
617
617
{
@@ -620,15 +620,15 @@ public static int Interrupt(ulong nativeThreadID)
620
620
return Runtime . PyThreadState_SetAsyncExc37Windows ( nativeThreadID , Exceptions . KeyboardInterrupt ) ;
621
621
}
622
622
623
- return Runtime . PyThreadState_SetAsyncExc37NonWindows ( ( UIntPtr ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
623
+ return Runtime . PyThreadState_SetAsyncExc37NonWindows ( new UIntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
624
624
}
625
625
626
626
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
627
627
{
628
- return Runtime . PyThreadState_SetAsyncExc36Windows ( ( long ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
628
+ return Runtime . PyThreadState_SetAsyncExc36Windows ( ( int ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
629
629
}
630
630
631
- return Runtime . PyThreadState_SetAsyncExc36NonWindows ( ( IntPtr ) nativeThreadID , Exceptions . KeyboardInterrupt ) ;
631
+ return Runtime . PyThreadState_SetAsyncExc36NonWindows ( new IntPtr ( nativeThreadID ) , Exceptions . KeyboardInterrupt ) ;
632
632
}
633
633
634
634
/// <summary>
0 commit comments