Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-01-20 10:54:06

Peter Dimov wrote:

> > #define ATOMIC_INIT(X) X
> > typedef long atomic_t;
> > static void atomic_inc(atomic_t*a_val){++*a_val;}
> > static long atomic_dec_and_test(atomic_t*a_val){return --*a_val;}
> > static long atomic_read(atomic_t const*a_val){return *a_val;}
> According to
> atomic_dec_and_test should return --*a_val == 0;
> BTW I thought that atomic.h was required to be present on Linux? It's in
> /usr/include/asm/atomic.h on my system.

Yes. Thanks. I should have asked earlier about atomic.h. My compiler
didn't include it; so, I had to add an -idirafter flag.

Anyway, the output is now what I'd expected:

TEST2:shared_ptr<SuperType> a_up(DerivedType*)
a_up.use_count(b4 reset)=1
subjB::operator b4 delete:0x80533b0
make: *** [run] Segmentation fault

Boost list run by bdawes at, gregod at, cpdaniel at, john at