Ticket #13476: thread_unsafe.patch

File thread_unsafe.patch, 1.2 KB (added by Nikita Kniazev <nok.raven@…>, 5 years ago)
  • include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp

    diff --git a/include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp b/include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp
    index ae2a66c50..c78365e79 100644
    a b  
    1515#include <boost/type_traits/add_pointer.hpp>
    1616#include <boost/type_traits/alignment_of.hpp>
    1717
     18#ifdef BOOST_DISABLE_THREADS
    1819#include <boost/thread/once.hpp>
     20#endif
    1921
    2022#include <memory>   // for placement new
    2123
    BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN  
    6971
    7072        static_(Tag = Tag())
    7173        {
     74#ifdef BOOST_DISABLE_THREADS
    7275            boost::call_once(&default_ctor::construct, constructed_);
     76#endif
    7377        }
    7478
    7579        operator reference()
    BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN  
    110114    template <class T, class Tag>
    111115    typename static_<T, Tag>::storage_type static_<T, Tag>::data_;
    112116
     117#ifdef BOOST_DISABLE_THREADS
    113118    template <class T, class Tag>
    114119#ifndef BOOST_THREAD_PROVIDES_ONCE_CXX11
    115120    once_flag static_<T, Tag>::constructed_ = BOOST_ONCE_INIT;
    116121#else
    117122    once_flag static_<T, Tag>::constructed_;
    118123#endif
     124#endif
    119125
    120126BOOST_SPIRIT_CLASSIC_NAMESPACE_END
    121127