-
-
Save rolfbjarne/cabc229f931376b46188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using ObjCRuntime; | |
static class NSThreadExtensions { | |
[DllImport("/usr/lib/libobjc.dylib")] | |
static extern void objc_msgSend (IntPtr receiver, IntPtr selector, double thread); | |
[DllImport("/usr/lib/libobjc.dylib")] | |
static extern double double_objc_msgSend (IntPtr receiver, IntPtr selector);> | |
public static void SetPriority (this NSThread thread, double priority) | |
{ | |
objc_msgSend (thread.Handle, Selector.GetHandle ("setThreadPriority:"), priority); | |
} | |
public static double GetPriority (this NSThread thread) | |
{ | |
return double_objc_msgSend (thread.Handle, Selector.GetHandle ("threadPriority")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment