mirror of
https://github.com/snltty/linker.git
synced 2025-12-24 12:38:04 +08:00
19 lines
378 B
C#
19 lines
378 B
C#
using System.Threading;
|
|
|
|
namespace common.libs
|
|
{
|
|
public static class BooleanHelper
|
|
{
|
|
public static bool CompareExchange(ref bool location, bool value, bool comparand)
|
|
{
|
|
bool result = location;
|
|
|
|
if(location == comparand)
|
|
{
|
|
location = value;
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|