1
1
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2025-12-15 13:35:09 -06:00

Move solution and projects to src

This commit is contained in:
TSR Berry
2023-04-08 01:22:00 +02:00
committed by Mary
parent cd124bda58
commit cee7121058
3466 changed files with 55 additions and 55 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Threading;
namespace Ryujinx.Graphics.GAL.Multithreading
{
static class ThreadedHelpers
{
public static void SpinUntilNonNull<T>(ref T obj) where T : class
{
Span<SpinWait> spinWait = stackalloc SpinWait[1];
while (obj == null)
{
spinWait[0].SpinOnce(-1);
}
}
public static void SpinUntilExchange(ref int target, int value, int comparand)
{
Span<SpinWait> spinWait = stackalloc SpinWait[1];
while (Interlocked.CompareExchange(ref target, value, comparand) != comparand)
{
spinWait[0].SpinOnce(-1);
}
}
}
}