2 // { dg-options "-fgnu-tm -O0" }
4 __attribute__((transaction_safe))
5 void* operator new (__SIZE_TYPE__);
7 __attribute__((transaction_pure))
8 inline int atomic_exchange_and_add( int * pw, int dv )
11 __asm__ ("" : "=r"(r));
18 int use_count_; // #shared
20 __attribute__((transaction_safe))
21 virtual void dispose() = 0; // nothrow
23 __attribute__((transaction_safe))
24 void release() // nothrow
26 if( atomic_exchange_and_add( &use_count_, -1 ) == 1 )
33 class sp_counted_base_x86 : public sp_counted_base
45 sp_counted_base * pi_;
48 __attribute__((transaction_safe))
49 shared_count(): pi_(new sp_counted_base_x86()), j(0)
52 __attribute__((transaction_safe))
53 ~shared_count() // nothrow
55 if( pi_ != 0 ) pi_->release();
64 __transaction_atomic {