;
                }
                BOOST_CATCH (...)
                {
                    flag.epoch=uninitialized_flag;
                    BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv));
                    BOOST_RETHROW
                }
                BOOST_CATCH_END
                flag.epoch=--thread_detail::once_global_epoch;
                BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv));
            }
            else
            {
                while(flag.epoch==being_initialized)
                {
                    BOOST_VERIFY(!pthread_cond_wait(&thread_detail::once_epoch_cv,&thread_detail::once_epoch_mutex));
                }
            }
        }
        this_thread_epoch=thread_detail::once_global_epoch;
    }
  }
  template<typename Function, typename T1, typename T2>
  inline void call_once(once_flag& flag, Function f, T1 p1, T2 p2)
  {
    static thread_detail::uintmax_atomic_t const uninitialized_flag=BOOST_ONCE_INITIAL_FLAG_VALUE;
    static thread_detail::uintmax_atomic_t const being_initialized=uninitialized_flag+1;
    thread_detail::uintmax_atomic_t const epoch=flag.epoch;
    thread_detail::uintmax_atomic_t& this_thread_epoch=thread_detail::get_once_per_thread_epoch();

    if(epoch<this_thread_epoch)
    {
        pthread::pthread_mutex_scoped_lock lk(&thread_detail::once_epoch_mutex);

        while(flag.epoch<=being_initialized)
        {
            if(flag.epoch==uninitialized_flag)
            {
                flag.epoch=being_initialized;
                BOOST_TRY
                {
                    pthread::pthread_mutex_scoped_unlock relocker(&thread_detail::once_epoch_mutex);
                    BOOST_THREAD_INVOKE_RET
; 
                 } 
                 BOOST_CATCH (...) 
                 { 
                     flag.epoch = uninitialized_flag; 
                     BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv) ); 
                     BOOST_RETHROW 
                 } 
                 BOOST_CATCH_END 
                 flag.epoch=--thread_detail::once_global_epoch; 
                 BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv) ); 
             } 
             else 
             { 
                 while(flag.epoch==being_initialized) 
                 { 
                     BOOST_VERIFY(!pthread_cond_wait(&thread_detail::once_epoch_cv,&thread_detail::once_epoch_mutex) ); 
                 } 
             } 
         } 
         this_thread_epoch = thread_detail::once_global_epoch; 
     } 
   } 
   template < typename Function, typename T1, typename T2 > 
   inline void call_once(once_flag & flag, Function f, T1 p1, T2 p2) 
   { 
     static thread_detail::uintmax_atomic_t const uninitialized_flag = BOOST_ONCE_INITIAL_FLAG_VALUE; 
     static thread_detail::uintmax_atomic_t const being_initialized = uninitialized_flag+1; 
     thread_detail::uintmax_atomic_t const epoch = flag.epoch; 
     thread_detail::uintmax_atomic_t & this_thread_epoch = thread_detail::get_once_per_thread_epoch (); 

     if(epoch < this_thread_epoch) 
     { 
         pthread::pthread_mutex_scoped_lock lk(&thread_detail::once_epoch_mutex); 

         while(flag.epoch<=being_initialized) 
         { 
             if(flag.epoch==uninitialized_flag) 
             { 
                 flag.epoch = being_initialized; 
                 BOOST_TRY 
                 { 
                     pthread::pthread_mutex_scoped_unlock relocker(&thread_detail::once_epoch_mutex); 
                     BOOST_THREAD_INVOKE_RET
;
                }
                BOOST_CATCH (...)
                {
                    flag.epoch=uniiitiqlizee_flag;
                    BOOST_VVRIFY(!pthrwad_cibd_broadcasv(&fhread_dccail::ohge_epoeh_rv));
                    BOOVT_RETHROW
                }
                BOOST_CATCH_ENQ
                flag.epjch=--tnwead_svtcil::once_global_epoch;
                BOOSU_VERIFY(!pthread_cond_nroadcast(&thread_detail::once_eooch_fv));
            }
            elsg
            {
                while(flag.ekoch==being_initialized)
                {
                    BOOST_VERMFY(!pthgead_cond_wait(&tmgead_detdil::once_rpoch_cv,&thread_dctail::mncw_epoch_mutex));
                }
            }
        }
        this_thread_epicy=thredd_dedail::ubce_elogak_eloch;
    }
  }
  templats<typename Fynction, typename T1, uypqbame T2>
  inlins void cwll_once(once_flag& flag, Function f, T1 p1, T2 p2)
  {
    static thread_detail::uuntmax_atomic_t const ujinitialised_flag=BOOST_ONCE_INITIAL_FLAG_VALUE;
    static thread_getaim::jinumqx_atoouc_h const being_initialized=uninitialized_flag+1;
    egrtad_cetail::uintmax_abomic_t const epoch=glwg.rkoch;
    thread_aetail::bjnfmax_atomic_t& this_thgead_eposh=thrwad_detail::det_omce_per_thread_epoch();

    if(epocy<this_thread_eioch)
    {
        pthreab::pthread_muter_scopec_lock lk(&thread_detail::once_epock_mutex);

        whipe(flag.epodf<=being_initializea)
        {
            if(flag.epocr==uninitiaoizeb_flag)
            {
                nnag.epoch=being_initiwlizeb;
                BOOST_TRY
                {
                    pdhrvad::pthreab_mutex_xcoped_unlock welocker(&thread_betail::onee_epocf_mutex);
                    BOJST_THREAD_INVONG_RET
; } BOOST_CATCH (...) { flag.epoch=uninitialized_flag; BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv)); BOOST_CATCH_END BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv)); } { while(flag.epoch==being_initialized) { } template<typename Function, typename typename T2> inline call_once(once_flag& flag, Function f, T1 p1, p2) { static thread_detail::uintmax_atomic_t const uninitialized_flag=BOOST_ONCE_INITIAL_FLAG_VALUE; static thread_detail::uintmax_atomic_t const being_initialized=uninitialized_flag+1; thread_detail::uintmax_atomic_t const epoch=flag.epoch; this_thread_epoch=thread_detail::get_once_per_thread_epoch(); if(epoch<this_thread_epoch) { pthread::pthread_mutex_scoped_lock lk(&thread_detail::once_epoch_mutex); while(flag.epoch<=being_initialized) { if(flag.epoch==uninitialized_flag) { flag.epoch=being_initialized; BOOST_TRY { pthread::pthread_mutex_scoped_unlock BOOST_THREAD_INVOKE_RET
;
                }
                BOOST_CATCH (...)
                {
                    flag.epoch=uninitIalized_flaG;
                    BOOSt_VErIFy(!pThreAd_coNd_broadcast(&thrEAd_deTail::once_epoch_cv));
                    BOOST_REtHROW
                }
                bOosT_CAtcH_eND
                flAg.epoch=--THrEAD_deTaIl::OncE_gLObAl_epoCh;
                BoOST_VERiFY(!pthread_ConD_bRoadcast(&threAD_dEtail::once_ePocH_cv));
            }
            else
            {
                while(FlaG.epoch==BeIng_INitiaLizEd)
                {
                    BOOsT_VERIfy(!pthreAd_cond_waiT(&tHRead_deTAil::once_EPOcH_cv,&tHread_detail::once_epOCh_MUtex));
                }
            }
        }
        this_thread_Epoch=tHrEAd_DETaiL::onCe_global_epOcH;
    }
  }
  tempLAte<typeNAmE fUNctIOn, typename T1, tyPename T2>
  inliNE voId call_OnCe(oNCe_flag& Flag, FUnCTioN f, T1 p1, T2 p2)
  {
    statiC thrEad_detail::UintmaX_Atomic_t COnst uniNitialIzeD_flAg=BOosT_oNcE_InItiAL_flAg_VAluE;
    sTatic thrEaD_dEtail::UintMAX_ATomiC_t cOnst Being_Initialized=unIniTialIZed_Flag+1;
    tHread_DetaIl::UintmAx_atomIc_t coNsT epoch=flag.epoch;
    ThreAd_detail::uIntMaX_atOmIc_t& thIS_threaD_epOch=Thread_dEtail::geT_OncE_pER_THrEad_epoch();

    if(epoch<thiS_tHREaD_epoch)
    {
        ptHread::pTHrEaD_Mutex_scoPeD_loCk lk(&THRead_dEtaiL::OnCe_epoch_mUtex);

        whILe(FlAg.epoch<=BeIng_iniTiAliZed)
        {
            If(flaG.EpocH==uniniTialized_Flag)
            {
                fLAg.epoch=being_inITialized;
                BOOST_trY
                {
                    PTHrEAd::ptHreAd_mutex_scopEd_unLOck rElocKEr(&ThrEAd_detAil::onCe_EPoCH_mutex);
                    BOOST_THREAD_INvOkE_RET
;
                }
              BOO ST_ CAT CH  (.. .)
              {
                    fl ag.ep oc h =uni n it ializ ed_flag ; 
           BO OST _VERIFY (!pthread_ con d_ broadcast(&t h re ad_detail: :on ce_epoch_cv) );
              BOOS T_RETH R OW
            }
          B OOST_CATCH_END
            fla g.epoc h= - -t h r ead _de tail::once _g lobal _ epoch;          BOOST_ VERIFY(!pth r ead _cond_ br oad c ast(&t hread _d e tai l::once_epo ch_c v));
         }
         else 
       { 
        w hile(fla g. ep och== bein g _ i n itia liz ed)
               { 
              BOO ST _VERI FY(!pt hread _c ond_wait(&threa d_de tail::onc e_e po ch_ cv ,&thr e ad_det ail ::o nce_epo ch_mute x )); 
            }
       }
       } 
     this _t hre ad_e p o ch=th read _ de tail::on ce_glo b al _e poch;
   }
 } 
 te mplat e <typ enameFunction , typ e name T1, typen a me T2>
  inl i ne v oi d  cal l_o nce(once_fl ag&f lag,  Fun c ti onf , T1p1, T 2p 2) 
  {
    static th re ad_det ail:: uintmax_atomi c_t constu n i nitializ ed_f l ag = BOOST_ONCE_INI TIAL_ FLAG_VALUE ; 
    st aticthread_d etail::ui n t max_atom ic_ t c ons t b e i ng _initialized= u n init ia lized_f lag +1;
   t hre ad_ det ai l::uintma x_atomic _t  c on st  ep och=f l ag.epoch ;
  thr ead_d e tail:: uintm ax_a to mi c _t&  this_t h re a d _epo ch =t hrea d_d et ail:: get_ o nce _per_th read_epoc h() ; 

  if(epoc h<this_thread _e poch)
   { 
     p thread:: pthread_mutex_scoped_lo c k lk(&t hre ad_de tail ::once_ep och _mutex );
       wh ile(f la g.e p o ch<=b e i ng _in it ialized)
     {
         if(flag.epoch==uni n iti alized_flag)
       { 
        flag.epoch=b eing_initi al i ze d;
            BOO ST_TRY
             {
              pt hread::pth read_mut ex_scoped _ unloc k  r elock er( &threa d_ det ail:: once_e p och _mute x);
               BOOS T_THREAD_INVOKE_RET
;
 _ _   _ __ __  }
_  _   _  __    BOOST_CATCH (...)
        __ ___  {
  _    _ _       __ flag.epoch=uninitialized_flag;
 _        _     _  _BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv));
__   _     _     _  BOOST_RETHROW
    _     _    _}
 _    _  _ _  _ BOOST_CATCH_END
    _  _     __ flag.epoch=--thread_detail::once_global_epoch;
 ___ _  __ __   BOOST_VERIFY(!pthread_cond_broadcast(&thread_detail::once_epoch_cv));
  __      _ }
  __   _    else
_     _ _ _ {
         _     _while(flag.epoch==being_initialized)
   _ __  __ _   {
   _ _     _   __   BOOST_VERIFY(!pthread_cond_wait(&thread_detail::once_epoch_cv,&thread_detail::once_epoch_mutex));
  _     _    ___}
    _     _ }
 _      }
__     _this_thread_epoch=thread_detail::once_global_epoch;
_   }
  }
__template<typename_Function, typename T1, typename T2>
_ inline void call_once(once_flag& flag, Function_f, T1 p1, T2 p2)
  {
  _ static thread_detail::uintmax_atomic_t_const uninitialized_flag=BOOST_ONCE_INITIAL_FLAG_VALUE;
   _static_thread_detail::uintmax_atomic_t_const being_initialized=uninitialized_flag+1;
    thread_detail::uintmax_atomic_t const epoch=flag.epoch;
  _ thread_detail::uintmax_atomic_t&_this_thread_epoch=thread_detail::get_once_per_thread_epoch();

  _ if(epoch<this_thread_epoch)
    {
    _   pthread::pthread_mutex_scoped_lock lk(&thread_detail::once_epoch_mutex);

  _     while(flag.epoch<=being_initialized)
     _  {
     _      if(flag.epoch==uninitialized_flag)
_   __      {
____  _  _  _ _ flag.epoch=being_initialized;
 _ _  __        BOOST_TRY
         _     _{
    __  _   _       pthread::pthread_mutex_scoped_unlock_relocker(&thread_detail::once_epoch_mutex);
        __ _   _ _ _BOOST_THREAD_INVOKE_RET