⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interlocked_read.hpp

📁 Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work
💻 HPP
字号:
#ifndef BOOST_THREAD_DETAIL_INTERLOCKED_READ_WIN32_HPP#define BOOST_THREAD_DETAIL_INTERLOCKED_READ_WIN32_HPP//  interlocked_read_win32.hpp////  (C) Copyright 2005-8 Anthony Williams ////  Distributed under the Boost Software License, Version 1.0. (See//  accompanying file LICENSE_1_0.txt or copy at//  http://www.boost.org/LICENSE_1_0.txt)#include <boost/detail/interlocked.hpp>#include <boost/config/abi_prefix.hpp>#ifdef BOOST_MSVCextern "C" void _ReadWriteBarrier(void);#pragma intrinsic(_ReadWriteBarrier)namespace boost{    namespace detail    {        inline long interlocked_read_acquire(long volatile* x)        {            long const res=*x;            _ReadWriteBarrier();            return res;        }        inline void* interlocked_read_acquire(void* volatile* x)        {            void* const res=*x;            _ReadWriteBarrier();            return res;        }        inline void interlocked_write_release(long volatile* x,long value)        {            _ReadWriteBarrier();            *x=value;        }        inline void interlocked_write_release(void* volatile* x,void* value)        {            _ReadWriteBarrier();            *x=value;        }    }}#elsenamespace boost{    namespace detail    {        inline long interlocked_read_acquire(long volatile* x)        {            return BOOST_INTERLOCKED_COMPARE_EXCHANGE(x,0,0);        }        inline void* interlocked_read_acquire(void* volatile* x)        {            return BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(x,0,0);        }        inline void interlocked_write_release(long volatile* x,long value)        {            BOOST_INTERLOCKED_EXCHANGE(x,value);        }        inline void interlocked_write_release(void* volatile* x,void* value)        {            BOOST_INTERLOCKED_EXCHANGE_POINTER(x,value);        }    }}#endif#include <boost/config/abi_suffix.hpp>#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -