Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-09-26 09:55:29


Alexander Terekhov wrote:

> John Torjo wrote:
> [...]
>
>>// here - you need InterlockedCompareExchange
>>// to realize that refcount is 0 (zero)
>>shared_ptr<test> p3 = weak.lock();
>
>
> lock() calls InterlockedCompareExchange (too bad it's fully fenced)
> if refcount isn't 0. Again, it can't see "false" zero.
>

of course - with the change I suggested ;)

I wanted to say that the original implementation
(http://www.pdimov.com/cpp/shared_count_x86_exp2.hpp) has a bug.
Take a look at it please.

Best,
John

-- 
John Torjo
-- john_at_[hidden]
Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
-- v1.4 - save_dlg - true binding of your data to UI controls!
    + easily add validation rules (win32gui/examples/smart_dlg)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk