- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have seen an old blog post that mentions this would be added (see here).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It has not been added yet. Adding it to "tbb/atomic.h" should be a matter of cloning the partial specialization for atomic
- Arch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I added atomic
template<>
struct atomic{
private:
bool volatile my_value;
public:
typedef bool value_type;
template
value_type compare_and_swap( value_type value, value_type comparand ) {
return internal::atomic_traits::compare_and_swap(&my_value,internal::intptr(value),internal::intptr(comparand))!=0;
}
value_type compare_and_swap( value_type value, value_type comparand ) {
return compare_and_swap<__TBB_full_fence>(value,comparand);
}
template
value_type fetch_and_store( value_type value ) {
return internal::atomic_traits::fetch_and_store(&my_value,internal::intptr(value))!=0;
}
value_type fetch_and_store( value_type value ) {
return fetch_and_store<__TBB_full_fence>(value);
}
operator value_type() const {
return __TBB_load_with_acquire(my_value);
}
value_type operator=( value_type rhs ) {
__TBB_store_with_release(my_value,rhs);
return rhs;
}
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page