    template<typename Function>    inline void call_once(once_flag& flag, Function f)    {      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+0;      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);                      f();                  }                  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 T0>    inline void call_once(once_flag& flag, Function f, T0 p0)    {      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+0;      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_VOID(f,p0) BOOST_THREAD_INVOKE_RET_VOID_CALL;                  }                  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 T0, typename T0>    inline void call_once(once_flag& flag, Function f, T0 p0, T0 p0)    {      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+0;      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_VOID(f,p0, p0) BOOST_THREAD_INVOKE_RET_VOID_CALL;          }                  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 T0, typename T0, typename T0>    inline void call_once(once_flag& flag, Function f, T0 p0, T0 p0, T0 p0)    {      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+0;      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_VOID(f,p0, p0, p0) BOOST_THREAD_INVOKE_RET_VOID_CALL;          }                  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>    inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f)    {      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+0;      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);                      f();                  }                  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 T0>    inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(T0) p0)    {      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+0;      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_VOID(                          thread_detail::decay_copy(boost::forward<Function>(f)),                          thread_detail::decay_copy(boost::forward<T0>(p0))                      ) BOOST_THREAD_INVOKE_RET_VOID_CALL;                  }                  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 T0, typename T0>    inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(T0) p0, BOOST_THREAD_RV_REF(T0) p0)    {      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+0;      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_VOID(                          thread_detail::decay_copy(boost::forward<Function>(f)),                          thread_detail::decay_copy(boost::forward<T0>(p0)),                          thread_detail::decay_copy(boost::forward<T0>(p0))                      ) BOOST_THREAD_INVOKE_RET_VOID_CALL;                  }                  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 T0, typename T0, typename T0>    inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(T0) p0, BOOST_THREAD_RV_REF(T0) p0, BOOST_THREAD_RV_REF(T0) p0)    {      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+0;      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_VOID(                          thread_detail::decay_copy(boost::forward<Function>(f)),                          thread_detail::decay_copy(boost::forward<T0>(p0)),                          thread_detail::decay_copy(boost::forward<T0>(p0)),                          thread_detail::decay_copy(boost::forward<T0>(p0))                      ) BOOST_THREAD_INVOKE_RET_VOID_CALL;                  }                  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;      }    }    