ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: [Boost.Thread] mutex Win32 implementation changes
by Alexander Terekhov other posts by this author
Jul 20 2004 8:13PM messages near this date
[boost] [Boost.Thread] mutex Win32 implementation changes | [boost] Re: [Boost.Thread] mutex Win32 implementation changes
Alexander Terekhov wrote:
>  
>  Alexander Terekhov wrote:
>  [...]
>  > Err.      m_retry_event.wait(), m_retry_event.set();
>  
>  I mean
>  
>    void lock() throw() {
>      if (int lock_status = m_lock_status.cas(0, 1, msync::ddacq)) {
>        do if (lock_status < 0 || m_lock_status.cas(1,-1, msync::ddacq))
>          m_retry_event.wait();
>        while (lock_status = m_lock_status.cas(0, 1, msync::ddacq));
>        m_retry_event.set();
>      }
>    }
>  
>    bool trylock() throw() {
>      return !m_lock_status.cas(0, 1, msync::ddacq);
>    }
>  
>    void unlock() throw() {
>      if (m_lock_status.swap(0, msync::rel) < 0)
>        m_retry_event.set();
>    }

Bad day. It still can go boom. Forget it. lock_queue is the way to go.

regards,
alexander.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Michael Glassford
Alexander Terekhov
Alexander Terekhov
Alexander Terekhov
Peter Dimov
Alexander Terekhov
Alexander Terekhov
Alexander Terekhov
val salamakha
val salamakha
val salamakha
val salamakha
Peter Dimov
Alexander Terekhov
Peter Dimov
Alexander Terekhov
Peter Dimov
Peter Dimov
Alexander Terekhov
Peter Dimov
Alexander Terekhov
Alexander Terekhov
Alexander Terekhov
Alexander Terekhov
Alexander Terekhov
Michael Glassford
Alexander Terekhov
Michael Glassford

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved