diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 3840773af9..4fd17623ff 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1099,14 +1099,18 @@ namespace OpenSim.Framework /// Is the platform Windows? /// /// true if so, false otherwise + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsWindows() { + return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + /* PlatformID platformId = Environment.OSVersion.Platform; return (platformId == PlatformID.Win32NT || platformId == PlatformID.Win32S || platformId == PlatformID.Win32Windows || platformId == PlatformID.WinCE); + */ } public static bool LoadArchSpecificWindowsDll(string libraryName) @@ -3100,6 +3104,39 @@ namespace OpenSim.Framework return false; } + [DllImport("winmm.dll")] + private static extern uint timeBeginPeriod(uint period); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TimeBeginPeriod(uint period) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + timeBeginPeriod(period); + } + + [DllImport("winmm.dll")] + private static extern uint timeEndPeriod(uint period); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TimeEndPeriod(uint period) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + timeEndPeriod(period); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ThreadSleep(int period) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + timeEndPeriod(1); + Thread.Sleep(period); + timeEndPeriod(1); + } + else + Thread.Sleep(period); + } + /// /// Used to trigger an early library load on Windows systems. /// diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4284c5304a..57c64cda5a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -154,7 +154,7 @@ namespace OpenSim.Region.ScriptEngine.Shared while (++comma < str.Length) { c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma); - if (c == ' ' || c == '>') + if (c == '>') break; }