//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

namespace CommonHelpers {

//**************************************************************************************************
partial class HUnsafePtr {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[HFullFunctionalModeRequired]
public static unsafe void* InterlockedExchange( [HIn][HOut][HInterlockedAccess]
                                                void** pPointerOperand,
                                                void* substutionPointerValue )
{
   HUnsafePtrArgChecking.VerifyNotNull( pPointerOperand );
   return PAccessHlp.InterlockedExchangePtr(
      pPointerOperand, substutionPointerValue );
}

[HFullFunctionalModeRequired]
public static unsafe void* _InterlockedExchange( [HIn][HOut][HInterlockedAccess]
                                                 void** pPointerOperand,
                                                 void* substutionPointerValue )
{
   return InterlockedExchange( pPointerOperand, substutionPointerValue );
}

//--------------------------------------------------------------------------------------------------

[HFullFunctionalModeRequired]
public static unsafe void* InterlockedNullValueExchange( [HIn][HOut][HInterlockedAccess]
                                                         void** pPointerOperand )
{
   return InterlockedExchange( pPointerOperand, NullValue );
}

[HFullFunctionalModeRequired]
public static unsafe void* InterlockedAllBitsValueExchange( [HIn][HOut][HInterlockedAccess]
                                                            void** pPointerOperand )
{
   return InterlockedExchange( pPointerOperand, AllBitsValue );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HUnsafePtr
//**************************************************************************************************

} // CommonHelpers
