/*
 * Copyright (C) 2020-2021 Aloysius Indrayanto
 *
 * This file is part of the eCxx library, see LICENSE file for the license details.
 */


#ifndef ECXX_PLATFORM_DUMMY_ATOMIC_GUARD_H
#define ECXX_PLATFORM_DUMMY_ATOMIC_GUARD_H


#include <eCxx/CTL/UninstantiableUncopyable.h>


namespace eCxx {


//
// A dummy atomic guard
//
class AtomicGuard : public Uncopyable {
    public:
        inline AtomicGuard() __ECXX_ATTR_ALWAYS_INLINE
        {
            __asm__ __volatile__ (
                "nop \n\t"
                ::: "memory"
            );
        }

        inline ~AtomicGuard() __ECXX_ATTR_ALWAYS_INLINE
        {
            __asm__ __volatile__ (
                "nop \n\t"
                ::: "memory"
            );
        }
};


} // namespace eCxx


#endif
