//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Implements a semaphore When we switch to C++20 we can use counting_semaphore to unify this
///
///
/// C++:
/// Jolt/Core/Semaphore.h:31
///
/// class Semaphore
///
///
[InteropHandle]
public readonly partial struct Semaphore : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Core/Semaphore.h:35
///
/// Semaphore()
///
///
public static Semaphore Create() => Jolt.PInvoke.Semaphore_Create();
///
///
/// Release the semaphore, signaling the thread waiting on the barrier that there may be work
///
///
/// C++:
/// Jolt/Core/Semaphore.h:39
///
/// void Release(uint inNumber = 1)
///
///
public void Release(uint number = 1) => Jolt.PInvoke.Semaphore_Release(this, number);
///
///
/// Acquire the semaphore inNumber times
///
///
/// C++:
/// Jolt/Core/Semaphore.h:42
///
/// void Acquire(uint inNumber = 1)
///
///
public void Acquire(uint number = 1) => Jolt.PInvoke.Semaphore_Acquire(this, number);
///
///
/// Get the current value of the semaphore
///
///
/// C++:
/// Jolt/Core/Semaphore.h:45
///
/// inline int GetValue() const
///
///
public int GetValue() => Jolt.PInvoke.Semaphore_GetValue(this);
public void Dispose() => Jolt.PInvoke.Semaphore_Destroy(this);
}
}