- XBT_IN("(%p)", cond);
- XBT_DEBUG("Destroy condition %p", cond);
- if (cond != nullptr) {
- intrusive_ptr_release(cond);
- }
- XBT_OUT();
-}
-
-void intrusive_ptr_add_ref(s_smx_cond_t* cond)
-{
- auto previous = cond->refcount_.fetch_add(1);
- xbt_assert(previous != 0);
-}
-
-void intrusive_ptr_release(s_smx_cond_t* cond)
-{
- if (cond->refcount_.fetch_sub(1) == 1) {
+ if (cond->refcount_.fetch_sub(1, std::memory_order_release) == 1) {
+ std::atomic_thread_fence(std::memory_order_acquire);