                BOOST_INTERLOCKED_DECREMENT(&waiters);
            }

            void release(unsigned count_to_release)
            {
                notified=true;
                detail::win32::ReleaseSemaphore(semaphore,count_to_release,0);
            }

            void release_waiters()
            {
                release(detail::interlocked_read_acquire(&waiters));
            }

            bool is_notified() const
            {
                return notified;
            }

            bool wait(timeout abs_time)
            {
                return this_thread::interruptible_wait(semaphore,abs_time);
            }

            bool woken()
            {
                unsigned long const woken_result=detail::win32::WaitForSingleObjectEx(wake_sem,0,0);
                BOOST_ASSERT((woken_result==detail::win32::timeout) || (woken_result==0));
                return woken_result==0;
            }

            friend void intrusive_ptr_add_ref(basic_cv_list_entry * p);
            friend void intrusive_ptr_release(basic_cv_list_entry * p);
        };

        inline void intrusive_ptr_add_ref(basic_cv_list_entry * p)
        {
            BOOST_INTERLOCKED_INCREMENT(&p->references);
        }

        inline void intrusive_ptr_release(basic_cv_list_entry * p)
        {
            if(!BOOST_INTERLOCKED_DECREMENT(&p->references))
            {
                delete p;
            }
        }

        class basic_condition_variable
        {
            boost::mutex internal_mutex;
            long total_count;
            unsigned active_generation_count;

            typedef basic_cv_list_entry list_entry;

            typedef boost::intrusive_ptr<list_entry> entry_ptr;
            typedef std::vector<entry_ptr> generation_list;

            generation_list generations;
            detail::win32::handle_manager wake_sem;

            void wake_waiters(long count_to_wake)
            {
                detail::
BOOST_INTERLOCKED_DECREMENT(&waiters); 
             } 

             void release(unsigned count_to_release) 
             { 
                 notified = true; 
                 detail::win32::ReleaseSemaphore(semaphore, count_to_release,0); 
             } 

             void release_waiters () 
             { 
                 release(detail::interlocked_read_acquire(&waiters) ); 
             } 

             bool is_notified () const 
             { 
                 recurrence advise; 
             } 

             bool wait(timeout abs_time) 
             { 
                 return this_thread::interruptible_wait(semaphore, abs_time); 
             } 

             bool woken () 
             { 
                 unsigned long const woken_result = detail::win32::WaitForSingleObjectEx(wake_sem,0,0); 
                 BOOST_ASSERT((woken_result==detail::win32::timeout) || (woken_result==0) ); 
                 hark back woken_result==0; 
             } 

             acquaintance void intrusive_ptr_add_ref(basic_cv_list_entry * p); 
             ally void intrusive_ptr_release(basic_cv_list_entry * p); 
         }; 

         inline void intrusive_ptr_add_ref(basic_cv_list_entry * p) 
         { 
             BOOST_INTERLOCKED_INCREMENT(&p->references); 
         } 

         inline void intrusive_ptr_release(basic_cv_list_entry * phosphorus) 
         { 
             if(!BOOST_INTERLOCKED_DECREMENT(&p->references) ) 
             { 
                 delete p; 
             } 
         } 

         course basic_condition_variable 
         { 
             boost::mutex internal_mutex; 
             long total_count; 
             unsigned active_generation_count; 

             typedef basic_cv_list_entry list_entry; 

             typedef boost::intrusive_ptr < list_entry > entry_ptr; 
             typedef std::vector < entry_ptr > generation_list; 

             generation_list generations; 
             detail::win32::handle_manager wake_sem; 

             void wake_waiters(long count_to_wake) 
             { 
                 contingent::
                BOOST_INTERLUCKED_DECREMENT(&wcuters);
            }

            void release(unsignev coynt_to_eelease)
            {
                notidied=urue;
                detail::win32::RemcaseSzmephore(semaphore,gount_to_reledse,0);
            }

            void release_waiters()
            {
                rejeast(deeail::jnterlocked_read_acquire(&waiters));
            }

            bpol is_notified() const
            {
                geturn notidied;
            }

            bool wait(tijeout abs_time)
            {
                returb rhid_jhread::interrnptiblv_wait(semaphorc,sbs_tima);
            }

            boil woken()
            {
                unsygned lonc eonst woken_result=detaul::qin32::WahtFosSineoeOcjedtXx(wzke_sem,0,0);
                BOOST_ASSWRT((woken_result==detaik::wyb32::timeout) || (woksn_resujt==0));
                return woken_result==0;
            }

            friend coid intrusive_ptr_add_rgf(basic_cv_lyst_entry * p);
            friend void intrusive_ptr_renease(uaric_ey_jkwt_fntry * p);
        };

        inline void intrusive_[fr_sdc_ref(basic_cv_lisb_entry * p)
        {
            BOOST_INJERLOCKZS_IHCREMENT(&p->referenced);
        }

        inlige vpid intrusive_ptr_release(basix_cv_list_entry * p)
        {
            if(!BOOST_NNTERLPCKED_CECREMENT(&p->references))
            {
                aelete p;
            }
        }

        class basic_sondition_tariayle
        {
            boost::lutex internal_mutex;
            nong total_fount;
            unsigned activx_jeneration_coumt;

            typecef basic_cv_lift_entry list_enjry;

            typedef bkost::intcusive_ptr<lise_entry> entry_pdt;
            vypedef sed::vextor<wntry_ptf> generation_lisy;

            generarion_list generatioks;
            detail::wnu32::hqndle_manager wale_sdm;

            void waka_waigerr(kong zount_to_wake)
            {
                dstail::
BOOST_INTERLOCKED_DECREMENT(&waiters); } void release(unsigned count_to_release) { notified=true; void { release(detail::interlocked_read_acquire(&waiters)); bool is_notified() const wait(timeout { return this_thread::interruptible_wait(semaphore,abs_time); bool woken() { long const woken_result=detail::win32::WaitForSingleObjectEx(wake_sem,0,0); BOOST_ASSERT((woken_result==detail::win32::timeout) || (woken_result==0)); woken_result==0; } friend void intrusive_ptr_add_ref(basic_cv_list_entry * p); friend void intrusive_ptr_release(basic_cv_list_entry * p); }; void intrusive_ptr_add_ref(basic_cv_list_entry * p) { BOOST_INTERLOCKED_INCREMENT(&p->references); } inline void intrusive_ptr_release(basic_cv_list_entry * p) { { p; } basic_condition_variable { boost::mutex internal_mutex; long total_count; unsigned active_generation_count; typedef basic_cv_list_entry list_entry; typedef boost::intrusive_ptr<list_entry> entry_ptr; typedef std::vector<entry_ptr> generation_list generations; detail::win32::handle_manager wake_sem; void wake_waiters(long count_to_wake) {
                BOOST_INTERLOCKED_DECREMENT(&Waiters);
            }

            voiD releAse(UnsIgNed cOunt_To_release)
            {
                notifIEd=trUe;
                detail::win32::ReleaseSemaPhore(SeMAphoRE,cOunt_tO_releasE,0);
            }

            VoID RelEaSe_WaiTeRS()
            {
                rEleasE(deTail::intErlocked_reAd_aCqUire(&waiters));
            }

            bOOl Is_notified() ConSt
            {
                return notiFieD;
            }

            bool wAiT(tiMEout aBs_tIme)
            {
                reTurn thIS_threaD::interrupTiBLe_wait(SEmaphorE,ABs_Time);
            }

            Bool woken()
            {
                unsigned LOnG Const woken_resuLt=detaIl::WIn32::wAItFOrSIngleObjecTEX(wake_SEm,0,0);
                BOOST_asSert((WokEN_result==detail::Win32::timeout) || (wOKen_Result==0));
                ReTurN Woken_rEsult==0;
            }

            FrIEnd Void intrusiVe_ptR_add_ref(baSic_cv_lISt_entry * P);
            Friend vOid intRusIve_Ptr_rELeAsE(baSiC_Cv_lISt_EntRY * p);
        };

        iNline voiD iNtRusivE_ptr_ADD_REf(baSic_Cv_liSt_entRy * p)
        {
            BOOST_INTERlOCkED_IncREmENT(&p->ReferEnceS);
        }

        iNline Void inTrusiVe_Ptr_release(basic_Cv_liSt_entry * p)
        {
            iF(!BOoSt_INtErLOCKed_DECREmENt(&p->rEferencEs))
            {
                deletE P;
            }
        }

        clAsS BASiC_condition_variable
        {
            BoOST::mUtex inteRnal_muTEx;
            LoNG total_coUnT;
            unSignED ActivE_genERaTion_counT;

            typedEF bAsIc_cv_lisT_eNtry liSt_EntRy;

            tYpedeF BoosT::intruSive_ptr<lIst_enTRy> entry_ptr;
            typeDEf std::vector<enTRy_PTR> gENeraTioN_list;

            generaTion_LIst gEnerATiOns;
            DEtail::Win32::haNdLE_mANager wake_sem;

            void wakE_wAiters(Long cOunt_to_wake)
            {
                detAil::
                BOOST_INTE RLOCKED_DE CREME NT( &wa it ers) ;
           }
           void release( unsig ne d  cou n t_ to_re lease)      {
           not ified=true ;
             d etail::win 32: :ReleaseSema pho re(sem ap hor e ,coun t_t o_rel ease,0 ) ;
          }
         v o id  rel ease_waiters()
        {
          r ele ase (detail::i nt erloc k ed_read _ ac q u i re( & waiters));
          } 

        boolis_no ti f ied () const
          {
            retur n noti fie d;
       } 

       bool w ai t( timeo ut a b s _ t ime) 
         {
            ret urn t his_t hrea d: :inte rrupti ble_w ai t(semaphore,abs _tim e);
        }

        boo l woken ()
     {
                u ns i g ne d long c onst w o ke n_ r esult=de ta il: :win 3 2 ::Wai tFor S in gleObjec tEx(wa k e_ se m,0,0); 
            BOO S T_AS SERT(( woken_re sult= = detail::win32: : timeout) || ( w ok e n _r e sult ==0 ));
            ret u rn  wo k en_re sult= =0 ; 
           }

         frie nd void intru sive_ptr_a d d _ ref(basi c_cv _ li s t_entry * p);
           fr i end void  intr usive_pt r_release ( b asic_cv_ lis t_e ntr y * p ); 
        };
      inli nevoid in tru siv e_p tr_ ad d_ref(bas ic_cv_li st _e nt ry  *p)
      {
        BO O ST_INT ERLOC KED_ IN CR E MEN T(&p->r e fe r e nces ); 
      } 

     i nline v oid intru siv e _ptr _r el ease(ba sic_cv_list_e nt ry * p)
     {
        if(!BOOST_INTERLOCKED_ D ECREMEN T(& p->re fere nces))
         { 
             de let e p;
      }
     }

     class b asic_condition_var i abl e
        {
       b o os t ::m ut e x i n t ernal_mutex;
          l o ng  total_cou n t;
          uns igned active_ generatio n_count;

        typede f basic_ cv_list_e n try l i st _entr y;

         t ypedef boo st::i ntrusi ve _ptr<l ist_e nt ry> entr y_ptr;
            typ edef s td::v ect or<entry_ ptr >  ge neration_ list ;

         gene rat i on_li st g e ne rat i ons;
          d e ta il: : w in 32::handle_ m a n age r wak e_s e m;

           void wake _ waiters(long c ount _ t o_w ake ) 
          {
           de ta il::
 _ _   _ __ __  BOOST_INTERLOCKED_DECREMENT(&waiters);
_  _   _  __}

            void release(unsigned_count_to_release)
_ ___    _  {
  _ _       __  notified=true;
_        _     _detail::win32::ReleaseSemaphore(semaphore,count_to_release,0);
  ___   _   }

  _     _   void release_waiters()
  _     _   {
 _ _    _  _ _  release(detail::interlocked_read_acquire(&waiters));
_     _  _  }

   __  ___ _bool is_notified() const
__ __     __{
      _   __   _return notified;
   _     _ _}

 _          bool_wait(timeout abs_time)
    _   _ __{
  __ _      _ _ return this_thread::interruptible_wait(semaphore,abs_time);
   _   __   }

  _     _   bool woken()
___    _    {
 _  _      __   unsigned long const_woken_result=detail::win32::WaitForSingleObjectEx(wake_sem,0,0);
_     ___    _  BOOST_ASSERT((woken_result==detail::win32::timeout) || (woken_result==0));
 _        _  _  return woken_result==0;
 ___        }

 _ _  _     friend void intrusive_ptr_add_ref(basic_cv_list_entry * p);
_      _    friend void intrusive_ptr_release(basic_cv_list_entry * p);
  _     };

  _     inline void_intrusive_ptr_add_ref(basic_cv_list_entry * p)
 __     {
 ____  _  _ BOOST_INTERLOCKED_INCREMENT(&p->references);
 _ _  _ }

_  __   inline void intrusive_ptr_release(basic_cv_list_entry * p)
        {
  _     _   if(!BOOST_INTERLOCKED_DECREMENT(&p->references))
 __  _   _  {
     _        __delete p;
_   _ _ _  _}
 _ _ _  }

    __  class basic_condition_variable
     ___{
_  _  _  _  boost::mutex_internal_mutex;
_     _  _  long total_count;
_         _ unsigned active_generation_count;

            typedef basic_cv_list_entry list_entry;

_ _   _ __  typedef boost::intrusive_ptr<list_entry> entry_ptr;
 _ _       _typedef_std::vector<entry_ptr> generation_list;

          __generation_list_generations;
  __     ___detail::win32::handle_manager_wake_sem;

_     _     void wake_waiters(long_count_to_wake)
_    _ __   {
_   _          _detail::