Boost logo

Boost :

From: Pavel Vasiliev (pavel_at_[hidden])
Date: 2003-02-11 13:04:00


Alexander Terekhov wrote:

> Pavel Vasiliev wrote:
> [...]
>> Thread A, in release_strong:
>> atomic_decrement(&strong_count) == 0,
>> enter strong_refs_lost(),
>> lock

> ACK.

>> Thread B, in acquire_strong_from_weak: ....

> NAK.

> Thread B, in release_weak:
> atomic_decrement(&weak_count) == 0,
>> Thread A, in strong_refs_lost:
>> see strong_count == 0,
> acquire_weak() --> weak_count == 1,
> ...
> enter release_weak(),
> atomic_decrement(&weak_count) == 0,
> Thread B, enter weak_refs_lost():
> ...
> destruct_self()
> Thread A, enter weak_refs_lost():

> WHACK!

Ok, indeed "WHACK!" :-)
But my idea with initial weak_count == 0 in any case was not good.
Please see my previous reply that fixes it, now reading not
"aesthetic feelings" but "ordinary correctness". (Hope to have this
correctness now.)

Pavel


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