1 using System.Runtime.InteropServices;
17 [DllImport(
"kernel32.dll")]
18 public extern static int GetCurrentProcessorNumber();
21 private static bool GetCurrentProcessorNumberIsAvailableResult =
false;
22 private static bool GetCurrentProcessorNumberIsAvailableChecked=
false;
23 private static object GetCurrentProcessorNumberIsAvailableLocker =
new object();
28 public static bool GetCurrentProcessorNumberIsAvailable
32 lock (GetCurrentProcessorNumberIsAvailableLocker)
34 if (GetCurrentProcessorNumberIsAvailableChecked)
return GetCurrentProcessorNumberIsAvailableResult;
38 GetCurrentProcessorNumberIsAvailableResult =
true;
42 GetCurrentProcessorNumberIsAvailableResult =
false;
45 return GetCurrentProcessorNumberIsAvailableResult;
static int GetCurrentProcessorNumber()
Gets the current processor number.
This class contains import of the kernel32.dll